Charles Greathouse on Wed, 09 May 2012 20:21:07 +0200 |
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Re: ispolygonal |
I'm not sure if the explosion of error types would be useful. Maybe it would be best to stick to just one or two (e_INEQUALITY, e_BADINPUT by whatever name). Charles Greathouse Analyst/Programmer Case Western Reserve University On Wed, May 9, 2012 at 10:35 AM, Karim Belabas <Karim.Belabas@math.u-bordeaux1.fr> wrote: > * Bill Allombert [2012-05-09 16:15]: >> On Wed, May 09, 2012 at 02:20:52PM +0200, Karim Belabas wrote: >>> The rationale was to avoid the e_MISC error type [ which is essentially >>> impossible to trap cleanly ], and consider that the expected input >>> "type" was 'a t_INT in Z_{> 2}'. >>> >>> This is a bit far-fetched and potentially confusing, I temporarily changed >>> it to e_MISC. >>> >>> Presumably we need a general error type for "violated inequality" ? >>> >>> pari_err(e_INEQ, "ispolygonal", "s > 2", s); >> >> We could define >> pari_err(e_TOOSMALL,"ispolygonal",s,gen_2) >> --> "%s: %Ps must be > %Ps" >> In practice I expect this would cover almost all case and allow the user >> to retrieve the inequality. > > We might need > > e_TOOSMALL (must have s > ...) > e_TOOLARGE (must have s < ...) > e_BADVALUE (must have s != ...) > > In fact, I'd expect the last one (BADVALUE) to be the most common (0 in > arithmetic functions, poles of transcendental functions, etc.). > > The second one might not be needed at all since e_OVERFLOW might cover > all existing cases. > > 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/~belabas/ > F-33405 Talence (France) http://pari.math.u-bordeaux1.fr/ [PARI/GP] > `