# [PD] Infinite and NaN float values?

Mathieu Bouchard matju at artengine.ca
Tue Aug 17 00:45:14 CEST 2010

```On Mon, 16 Aug 2010, Matteo Sisti Sette wrote:

> I think in this cases the limit is said to be "infinity" (without sign),
> meaning that being y=f(x),

Not all number systems have a single infinity. standard floats have a
split infinity. In math, the usual Extended Reals have a split infinity,
but there's another kind of Extended Reals that have a unified infinity.
The usual Extended Complexes have a unified infinity, but it's possible to
imagine variations that have a continuum of different infinities making a
"circle" "around" the complex plane...

> for every M>0 (no matter how big) you can always find a T>0 such that for all
> x:|x|<T you have |f(x)|>M.

float math doesn't have a thing that we could call an "always-positive
context" that would cause 1/|x| or 1/x² to be considered as +Inf at x=0,
because at the point where the division happens, the computer has
forgotten any trace of the preceding stuff that could allow it to compute
a limit...

> I think that is said to be an infinite limit (rather than non existing
> limit),

only in a number system that has a unified (signless) infinity. you can't
suppose that here.

> I think there exists a "compactification" of real numbers that takes this
> "limit" as one more number which is Infinity (without sign), thus making R
> compact (visually represented by mapping real numbers to the points of a
> circumference rather than a straight line).

Yes, that's what I mean by unified infinity instead of split infinity.
This makes tan(x) a continuous function, for example.

> I don't know if this applies to complex numbers also.

For complex numbers, the usual "compactification is onto a sphere,
projecting from a point on the top of the sphere, where the sphere is on
top of the origin of the plane.

> In ActionScript actually (which is not a great example language but it is the
> one with which I could check right now), 5/0 gives Infinity, and -5/0 gives
> -Infinity.

Actually, I just checked it out, and the C language does it the same.
Also, 5/-0 gives -Infinity, just to mess with our sense that +0 and -0 are
supposed to be the same...

But 0/0 is NaN.

> Don't most programming languages behave like this? I always though NaN
> was only the result of 0/0 (and Inf-Inf, and other operations where any
> ""limit"" would be nonexistent), but I didn't consider the problem you

It's a common source of disagreement. Eventually, any system of rules for
handling infinity will "fail" at one point. The lesson is to avoid using
infinity as much as possible... that's why modern calculus uses workaround
definitions of the form "for each epsilon>0..." "there exists a delta such
that..." and "there exists a N beyond which..." to carefully avoid saying
anything like "infinity" ever. It's a TRAP !

> 0   ==  -0    -> true
> 1/0 == 1/-0   -> false

yeah. that's an IEEE standard, it seems. LOL

_ _ __ ___ _____ ________ _____________ _____________________ ...
| Mathieu Bouchard, Montréal, Québec. téléphone: +1.514.383.3801
```