Karim BELABAS on Mon, 6 Oct 2003 19:21:46 +0200 (MEST)


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

Re: sqrtint(-N) is broken


On Thu, 25 Sep 2003, Bill Allombert wrote:
> It's look like sqrtint(-N) is broken.
>
> ? sqrtint(-18891990361510463883)
> %1 = -180277404801467*I
> ? sqrtint(18891990361510463883)
> %2 = 4346491730
[...]
> I would prefer sqrtint to fail on negative integers by the way. The
> current behavior just hide wrong input for a not really meaningful
> output, like

OK. I've disallowed it.

  (19:21) gp > sqrtint(-1)
    ***   negative integer in sqrtint.

    Karim.
-- 
Karim Belabas                     Tel: (+33) (0)1 69 15 57 48
Dép. de Mathématiques, Bât. 425   Fax: (+33) (0)1 69 15 60 19
Université Paris-Sud              http://www.math.u-psud.fr/~belabas/
F-91405 Orsay (France)            http://www.parigp-home.de/  [PARI/GP]