Bill Allombert on Sat, 29 Oct 2022 20:36:17 +0200


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

Re: arithmetic operations with t_INFINITY


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,...)

etc.
Cheers,
Bill.