Bill Allombert on Sat, 29 Oct 2022 11:13:07 +0200


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

Re: arithmetic operations with t_INFINITY


Le Fri, Oct 28, 2022 at 04:13:49PM -0400, Max Alekseyev a écrit :
> It seems reasonable to expect that "123 + oo" or "-567 * oo" should
> evaluate in "+oo" and "-oo", respectively, but at the moment they both
> result in the "forbidden" error.
> Can support of basic arithmetic operations for t_INFINITY be added?
> Of course, undefined operations such as "oo - oo" should still produce an
> error.

When we added oo, we decided that we would not allow arithmetic operations with
infinity because they are not well defined and and not obey the usual equations: 
a+x == b+x => a==b
etc.
so this can only lead to strange bugs.

Cheers,
Bill.