Michael Somos on Fri, 29 Oct 1999 16:48:59 -0400 (EDT)

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

sqr() bug?

                    GP/PARI CALCULATOR Version 2.0.17 (beta)
                i686 running linux (ix86 kernel) 32-bit version
              (readline v2.2 enabled, extended help not available)

                           Copyright (C) 1989-1999 by
          C. Batut, K. Belabas, D. Bernardi, H. Cohen and M. Olivier.

Type ? for help, \q to quit.
Type ?12 for how to get moral (and possibly technical) support.

   realprecision = 28 significant digits
   seriesprecision = 16 significant terms
   format = g0.28

parisize = 4000000, primelimit = 500000
gp> ??sqr

   square of x. Not identical to x*x in the case of 2-adics, where it returns a
more precise result.

   The library syntax is gsqr(x).

gp> (5+O(2^10))^2
%1 = 1 + 2^3 + 2^4 + O(2^11)
gp> sqr(5+O(2^10))
%2 = 1 + 2^3 + 2^4 + O(2^11)

Perhaps I am misunderstanding the documentation. Where is the "more
precise result"? The results seem identical to me for 2-adics. Shalom,

Michael Somos <somos@grail.cba.csuohio.edu>     Cleveland State University
http://grail.cba.csuohio.edu/~somos/            Cleveland, Ohio, USA 44115