Max Alekseyev on Sat, 29 Oct 2022 22:39:27 +0200

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

Re: arithmetic operations with t_INFINITY

For this purpose, the function isinfinite(v) (or alike) would be more suitable, or checking the equality type(v) == "t_INFINITY".
Testing "v == oo" is not mathematically rigorous and should be forbidden in my opinion.


On Sat, Oct 29, 2022 at 2:35 PM Bill Allombert <> wrote:
Le Sat, Oct 29, 2022 at 09:47:27AM -0400, Max Alekseyev a écrit :
> Well, having "oo == oo" violates the equivalence with "oo - oo == 0" where
> the lhs is not defined.

It is not different from t_STR and other types for which gsub is not defined.

> It is surely helpful to be able to compare finite numbers to +/- infinity,
> but I'm not quite sure why one would ever need to compare infinities and
> have "oo == oo" evaluated to 1.

The goal of oo is to be the infinity for the order:

v = valuation(P);
if (v == oo,...)
if (v > 0,...)