Karim Belabas on Fri, 10 Jun 2005 18:05:49 +0200


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

Re: dumb question about rationals


* Rampal Etienne [2005-06-10 17:39]:
> I also get this same error "Impossible assignment I --> S" when I try to 
> calculate lngamma(1E+10).
> 
> However, strangely enough, when I try to calculate lngamma(1E+10+1E-10), I 
> do not get this error!
> 
> What's happening here?????

This is a bug. 

The error means an unsuccessful attempt to convert a large PARI integer
[ (I)nteger ] into an ordinary C long [ (S)mall ].

The same piece of code computes lngamma(s) and gamma(s).  Part of that code
(when s is indistinguishable from an integer) was written with the mistaken
assumption that we're computing gamma(s), so s is not too large otherwise
overflow occurs. So that part is done with ordinary 'long' arithmetic,
which immediately overflows.

The problem is now fixed in CVS.

    Karim.
-- 
Karim Belabas                     Tel: (+33) (0)1 69 15 57 48
Dep. de Mathematiques, Bat. 425   Fax: (+33) (0)1 69 15 60 19
Universite Paris-Sud              http://www.math.u-psud.fr/~belabas/
F-91405 Orsay (France)            http://pari.math.u-bordeaux.fr/  [PARI/GP]