Ah. So there isn't any object representation of NaN lurking around somewhere, or something like that?
Hm, that code snippet ought only to be used if the C implementation is buggy...
/ Mirar
Previous text:
2004-01-12 13:13: Subject: icc & nan
Pike does not have its own implementations of the basic floating point operations (addition, multiplication, comparison, etc), so the C environment must provide such implementations with correct handling of NaN. For comparison, Pike can use the functions isless() instead of < if it exists. For equality, there actually seems to be some extra code that looks for NaN, but it looks broken:
case T_FLOAT: if (PIKE_ISNAN(a->u.float_number) != PIKE_ISNAN(b->u.float_number)) { return 0; } return a->u.float_number == b->u.float_number;
That should be ||, not !=. An even better solution would be to use isunordered() if it exists. I'll update the code.
/ Marcus Comstedt (ACROSS) (Hail Ilpalazzo!)