Bill Allombert on Tue, 23 Sep 2014 16:04:03 +0200


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

Re: [PATCH] enable basic arithmetic with infinity


On Tue, Sep 23, 2014 at 03:37:05PM +0200, Jeroen Demeyer wrote:
> Dear pari-dev,
> 
> The attached patch enables basic arithmetic with t_INFINITY. It adds
> support for addition, subtraction, multiplication and division of
> infinity by something (division by infinity is still an error). In
> all cases, the other operand must be a t_INT, t_REAL or t_FRAC.

Purposefully, we restricted the semantic attached to oo.
Most of the time such operations are the symptom of a bug.

> This patch (at least for multiplication) is needed to support Denis
> Simon's 2-descent script which does things like
> 
> if (lambda > 2*valuation(x,p),...)
> 
> where x can be 0. This gave no problems with PARI-2.7 and earlier
> because valuation(0,p) returned a very large number.

In this instance the assumption was that lambda is always smaller than
twice the large number returned by valuation().

This is a known issue in Denis scripts that I have fixed locally. 
Please send me the versions you use and I will send you the fixed versions.
(the change is very small: basically 
if (lambda > 2*valuation(x,p)
become
if (x!=0 && lambda > 2*valuation(x,p),...
at a couple of place).

Sorry or the trouble.

Cheers,
Bill.