Karim Belabas on Thu, 10 Apr 2014 13:05:56 +0200 |
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Re: +oo / -oo (infinity) |
* Andreas Enge [2014-04-10 12:38]: > On Thu, Apr 10, 2014 at 12:14:33PM +0200, Karim Belabas wrote: > > It's a bit sad to "waste" a type for only two objects so far, but it was the > > only sensible possibility. (I definitely didn't want to abuse one of the > > existing types, e.g. taking advantage of "impossible values" for t_REAL > > codewords.) > > It is not clear whether this would have been abuse; it could have been an > extension of the reals towards the IEEE semantics, maybe even with something > like 1.0/0.0=+oo. In particular for the example you give of an integral, > there is a notion of "real number" behind the infinity, unlike for the > polynomial degree. It would have been abuse in the sense of having to monitor every single occurence of t_REALs in the libpari code to check whether our change "extending the range" of existing t_REALs could possibly break something in the neighbourhood. There was a distinct possibility of introducing lots of obscure bugs in the process. (Been there, done that.) The current implementation is minimal, about 400 lines touching about 10 functions in simple ways. And a priori no potential for confusion since I had to explicitly introduce t_INFINITY in switches for the very functions I wanted to support; all the others are automatically handled through 'default' exceptions. It's quite possible to add new specific methods to handle this new type, I just didn't see any useful applications. :-) Cheers, K.B. -- Karim Belabas, IMB (UMR 5251) Tel: (+33) (0)5 40 00 26 17 Universite Bordeaux 1 Fax: (+33) (0)5 40 00 69 50 351, cours de la Liberation http://www.math.u-bordeaux1.fr/~kbelabas/ F-33405 Talence (France) http://pari.math.u-bordeaux1.fr/ [PARI/GP] `