10.02.2014, 19:08
(
Last edited by BigETI; 11/02/2014 at 07:38 PM.
)
Test for, if a floating point number is not a real number (including NaN and infinity):
Example:
pawn Code:
#define isnrn(%0) (((_:(%0))&0x7F800000) == 0x7F800000)
pawn Code:
//...
if(isnrn(1.0/0.0)) printf("ERROR!");
if(isnrn(floatsqroot(-1.0))) printf("ERROR!");
//...