On Jul 8, 2009, at 1:05 PM, Andres Valloud wrote:

> FWIW... VW has two choices... a) fail the primitives when the answer  
> is
> INF or NaN, or b) return whatever the FPU says.  Also, NaN and INF are
> regular instances of Float and Double...

Moreover:
if 1.0/0.0 yields a NaN Float
and 1.0d/0.0d yields a NaN Double,
what should 1/0 yield?

(And would that be a different NaN than (1/2) / 0 yields?)


R
-



>
> Reinout Heeck wrote:
>> On Jul 8, 2009, at 12:53 PM, Andres Valloud wrote:
>>
>>
>>> Well, but on the other hand, what happens when you do things like
>>> 1.0 +
>>> NaN or NaN + 1.0?  It should work...
>>>
>>
>> It will break further down the line though:
>>
>> (1.0 + NaN) < (1.0 + NaN)
>>
>> should that return NaB (not a Boolean)?
>>
>>
>> Shouldn't obtaining NaN from arithmetic be modeled as a resumable
>> exception, so the calling code can decide what kind of object to
>> return as the value? (Instead of only one choice being hardwired in
>> the system).
>>
>>
>>
>> R
>> -
>>
>>
>>
>
> _______________________________________________
> Pharo-project mailing list
> [email protected]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


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

Reply via email to