[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: arithmetic issues

Aubrey Jaffer <agj@xxxxxxxxxxxx> writes:

> That is a good point.  Of course you would want the written
> representation to match the literal form so it works for
> program-writing programs.  Argggh!
> In my experience writing lots of mathematical code, the trick is not
> generating NaNs, it is preventing them.  Searching through my 70000
> line Scheme codebase, I find no literal NaNs or infinities.

On the assumption that the literal form is rarely needed, it makes no
sense to have one.

An implementation might wisely provide a (nan) function that returns
one, however, to at least be prettier than (/ 0. 0.).  If NaNs carry
around extra origin-marking information too, the (nan) function would
be handy for that as well.