8 Feb
2006
8 Feb
'06
10:47 a.m.
Hi Mike!
I was wondering if it would be possible to include some method of determining if a function returns 'nan'?
This is a great idea. Added and committed to CVS. int math.isinf( float ) int math.isnan( float ) Also adding examples/basic/infnan.ck // big number 1000000000000000000000000000.0 => float n; // overflow it repeat( 20 ) n *=> n; // test it <<< math.isinf( n ) >>>; // bye sanity 0 *=> n; // test it <<< math.isnan( n ) >>>; // more <<< 1.0 / 0.0 => math.isinf >>>; <<< 0.0 / 0.0 => math.isnan >>>; So far, this seems portable on osx, linux, win32. We will see if and how it breaks under different systems as we go. Best, Ge!