John Cremona on Sun, 28 Sep 2014 11:24:06 +0200

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

Re: [PATCH] enable basic arithmetic with infinity

On 28 September 2014 08:36, Jeroen Demeyer <> wrote:
> Hi Karim,
> On 2014-09-27 15:44, Karim Belabas wrote:
>> Unfortunately, I made the mistake of allowing valuation(0) a long time
>> ago (circa 1995).
> Now that you are breaking backwards compatibility anyway, then this would be
> a good time to reconsider that decision.
> Consider the following two "extreme" cases:
> (A) valuation(0,p) is not allowed in any case and always raises an error.
> (B) valuation(0,p) is allowed and using it in mathematical operations (like
> 2*valuation(0,p)) works.

I vote for (A).   Users can get used to that, just as they are used to
log(1+x) being fine but log(x) raising an error, or 1/a raising an
error if a=0.

There will be scripts which need to be fixed, of course.


> I personally think (B) would be the best, but I much prefer (A) to what we
> have now. The current situation is a very strange middle ground: it's like
> PARI cannot really decide whether they want to allow or disallow people
> calling valuation(0,p). At least with (A) you get an error immediately
> instead of at some later time, which would make debugging easier. It also
> sends a clear message to PARI users about valuation(0,p).
>> I really don't want to instrument essentially all numerical functions to
>> make sense of infinities-as-actual-numbers, including beasts such as
>> a+I*oo which make perfect sense for complex integrals. A related
>> former TODO item was to introduce IEEE754 special values as t_REALs
>> (infinities, signed 0s, NaN, etc.): I decided against it a long time ago.
> I never asked for that and I also don't think that allowing 2*oo would force
> you to consider oo everywhere.