Simbody  3.8

isNaN(x) provides a reliable way to determine if x is one of the "not a number" floating point forms.

isNaN(x) provides a reliable way to determine if x is one of the "not a number" floating point forms.

Comparing x==NaN does not work because any relational operation involving NaN always return false, even (NaN==NaN)! This routine is specialized for all SimTK scalar types:

For complex and conjugate types, isNaN() returns true if either the real or imaginary part or both are NaN.