# [Gambas-user] Infinities and division

Jussi Lahtinen jussi.lahtinen at gmail.com
Wed Nov 30 02:20:57 CET 2022

```> Ah, I was talking about arithmetic using the constants not arithmetic on
> "actual infinities". In fact I am quite happy, mathematically, ...
>
Mathematically, infinity is not a number. And arithmetics on the constant
doesn't make much sense either, moreover it is completely unnecessary.
There are better ways than relying on it.
When people say 1 / Inf = 0, they mean the limit x->Inf, 1/x. Not the
actual calculation. 1 / Inf = 0 is simply wrong.

But +Inf / 2 is a completely different thing. A "very large (real) number"
> / 2 does equal a "very large (real) number" or does it?
>
What is the point? 1.63312393531954E+16 is also a very big number. The Inf
comes up when the result is too big for the variable or division by zero
(but error is raised on the latter).
It is not suitable for any calculations. It does *not* present a result of
valid computation.

> Is the
>
>  f(x)=Limit(x=1 -> +Inf) x / y
>
> ,where y is any fixed real number, computable?
>
I guess you mean:
Limit x->Inf, when f(x) = x/y
Not sure what you mean, but this limit does have a well defined answer and
it's infinity. Limits are very different things. I don't get what you are
implying by this.

IMO it should return NaN ... but I guess it's because there is a real
> number returned by Rad(90) and therefore a real result to the Tan()
> function.
>
Yes, floating points cannot represent Pi/2 (or any irrational numbers)
accurately.
You can see similar issues when you print out csingle(0.0001).

Jussi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20221130/6ccdd03b/attachment.htm>
```