Skip to content

Modern Math CNaN

Paul Squires edited this page Oct 19, 2026 · 5 revisions

Home › Math Library › Math Library › CNaN

CNaN

Returns a complex number whose two parts are both NaN.

Syntax

CNaN( ) as Complex

Notes

  • A function, not a constant, and here there is no alternative: const as Complex N = ( 0.0/0.0, 0.0/0.0 ) is a compile-time division by zero and does not compile. Same decision, same reason, as NaN( ) in math.tiko.
  • A NaN is not equal to itself, here as everywhere. Use CIsNaN to test for one, never = CNaN( ).
  • A number with one infinite part and one NaN part is not this. It is infinite — see CIsNaN.

Examples

#import "std/numeric"
using numeric

print CIsNaN( CNaN( ) )     '' true
print CNaN( ) = CNaN( )     '' false   -- never true, as for any NaN
print CToString( CNaN( ) )  '' nan+nani

Library: Math Library
Category: Math Library
Documented under: Members

Clone this wiki locally