Michael Somos on Sun, 31 Oct 1999 19:10:52 -0500 (EST)


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

various function bugs


In the current GP/PARI CALCULATOR Version 2.0.17 (beta) are a few bugs.
The most serious being :

gp> addprimes(0)
  ***   the PARI stack overflows !!!
gp> primes(-1)
  ***   segmentation fault: bug in GP (please report).

The next two do not seem correct. A string should not be a valid argument.

gp> gcd("a",0)
%40 = "a"
gp> binomial("a",0)
%31 = 1

I don't see how  0 = 0^1  is a valid factorization, but I could be wrong.

gp> factor(0)
%33 = 
[0 1]

Next, I think the error messages is not explicit enough or wrong.

gp> factor("a")
  ***   sorry, general factorization is not yet implemented.
gp> factorback("a")
  ***   incorrect factorisation in factorback.
gp> ffinit("a",1)
  ***   prime field too big in ffinit.
gp> issquare("a")
  ***   sorry, issquare for this type is not yet implemented.
gp> prime(-1)
  ***   not enough precalculated primes

Next, I think the error message is misleading. It implies that a negative
argument might be invalid, but that is not the case. In addition, I don't
know if the behavior of the functions for negative integers is documented.

gp> moebius(-1)
%31 = 1
gp> moebius(0)
  ***   negative or zero argument in an arithmetic function
p> numdiv(-1)
%32 = 1
gp> numdiv(0)
  ***   negative or zero argument in an arithmetic function
gp> omega(-1)
%33 = 0
gp> omega(0)
  ***   negative or zero argument in an arithmetic function
gp> sigma(-1)
%34 = 1
gp> sigma(0)
  ***   negative or zero argument in an arithmetic function


Shalom, Michael

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