|
From: Raymond T. <toy...@gm...> - 2014-09-03 16:08:36
|
>>>>> "Robert" == Robert Dodier <rob...@gm...> writes:
Robert> On 2014-09-01, David Billinghurst <dbm...@gm...> wrote:
>> I:87^611$
>> M:91^211$
>> sign(sqrt(I)-M);
Robert> Thanks for the example. Here's a proposed fix. This causes $FLOAT to
Robert> always fail (even for Lisps which otherwise allow float infinity)
Robert> and therefore SIGN1 takes a different route and sign returns 'pos.
Robert> The patch assumes that (float inf) minus (float inf) != 0.
Robert> I'm pretty sure that's required by IEEE 754 (in fact I think the
Robert> result is supposed to be NaN) but I can't quote chapter & verse
Robert> at the moment.
Yes, inf - inf is NaN, in IEEE754 arithmetic. As is inf*0. I would
add a comment to the code saying so for the next user who isn't so
familiar with IEEE754.
On the other hand, didn't you also write some kind of float-infinity-p
function already? If not, we should probably add a float-infinity-p
and float-nan-p functions just for cases like this.
--
Ray
|