(0011259 - 927 - 1044 - 1044 - 1044 - 1044 - 1044)
nicolas cellier
10-08-07 20:08
|
Note that in testNaN1 Float nan == Float nan does answer true.
It rely on the fact that Float nan is a constant ^NaN.
But has this any usefull meaning?
I mean, is this really a deliberated feature, or just a side effect of current implementation?
I tend to interpret it a side effect, because most operations will produce a NaN which is ~~ Float nan:
(0.0 ln / 0.0 ln) == Float nan. "is false"
(0.0 ln / 0.0 ln) isNan. "is true'
So user should never use test == Float nan. It might be true sometimes (when coming from Float nan or Number readFrom: 'NaN'), wrong most times.
User should use isNan. That's what the test should emphasize as a feature.
So, this == test just assert that implementation is what it is, which must NOT be interpreted by user as a feature.
This test just forbid implementation to change, which is arbitrary and useless, and might not be portable across dialects and/or versions. |