On 17/05/2017 17:43, Jori Mäntysalo wrote:
On Wed, 17 May 2017, Vincent Delecroix wrote:
An example is given by "is_cyclotomic" that returns either a boolean
or an integer
sage: x = polygen(ZZ)
sage: p = x^2 + x + 1
sage: p.is_cyclotomic()
True
sage: p.is_cyclotomic(certificate=True)
3
I suggest that certificate=True always returns a pair (i.e. a tuple of
two elements) where first value is True or False, and the second value
is the certificate or None.
Note that there are also advantages in favor of the current behavior of
is_cyclotomic:
1) it is compatible with PARI/GP
poliscyclo(f): returns 0 if f is not a cyclotomic polynomial, and n > 0
if f = Phi_n, the n-th cyclotomic polynomial.
2) you can do indifferently
if p.is_cyclotomic(certificate=False):
pass
if p.is_cyclotomic(certificate=True):
pass
Vincent
--
You received this message because you are subscribed to the Google Groups
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.