On Tue, Nov 16, 2010 at 3:17 AM, Benjamin
<[email protected]> wrote:
> On Nov 16, 2010, at 9:20 AM, Michael Roberts wrote:
>
>> isNaN
>>        "simple, byte-order independent test for Not-a-Number"
>>
>>        ^ self ~= self
>>
>> so something like this seems a better test
>>
>> association := #foo -> Float nan.
>> {association} anySatisfy: [:each | each value isNaN]
>>
>>
>> cheers,
>> Mike
>
>
> Thank you, it's a good clue :)
> It's not really cool to have to add special code to test NaN, but if it's
> the only way ...

NaN is an extremely special case. According to some random forum
posting I ran across talking about ISO floating point standards, for
example, HUGE_FLOAT * 0 is undefined (which seems ridiculous to me,
but there's probably a good reason for it, if it's true...which is
really completely beside the point). It might be 0, or it might be
NaN. Would you really want that value (in general) to be considered
equal to 1/0?

In my mind, they've pretty much wound in the same category as SQL's NULL.
>
> Ben

-- James

_______________________________________________
Pharo-users mailing list
[email protected]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-users

Reply via email to