[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Sorry to continue on this subject, but...
1. I'm glad to see that -0 will be removed. In the current reference
implementation, (+ 1 -1) returns 0, as does (+ -1 1), and it's very hard
for me to see why 0 is privileged over -0 in this case.
2. As you can probably guess from the fuss created by -0, exact
infinities sure as hell are not reciprocals of 0. Infinities can be
created by calculating a limit of lim x->(+)0 (1/x), but the existence
of a limit is required. This is because 0 _really is_ -0, and
consequently, 1/0 _really is_ 1/-0, that is, undefined.
So you might have two things to do, which are relatively orthogonal:
(a) define an exact NaN value, which is the result of division by zero,
and provide rules for handling NaN wrt basic arithmetic and boolean
operations (things like (> 0 NaN) are especially problematic);
(b) define exact (negative and positive) infinity, which are greater in
magnitude than any finitary exact number, but cannot be manipulated much
in any way; for example, (+ 1 inf) cannot evaluate to inf, because this
will break the numeric system. These infinities cannot be obtained as a
result from any calculation, but one can use them as literals.
I think the latter might have some value, for example as initialisation
values for algorithms searching for a maximum value in a list etc.
personal contact: atehwa@xxxxxx, +35841 5323835, +3589 85619369
work contact: pkalliok@xxxxxxxxxxxxxxxx, +35850 3678003
kotisivu (henkkoht): http://www.iki.fi/atehwa/
homepage (technical): http://sange.fi/~atehwa/