On 3/31/07, Pablo De Napoli <[EMAIL PROTECTED]> wrote: > In the process of investigating how rings are defined in sage I've found > some > inconsistencies: the function multiplicative_order is not consistently > defined > for all rings. > > Applying this function to a rational > integer which is not a unit raises an exception: > > sage: a=ZZ(3) > sage: a.multiplicative_order() > --------------------------------------------------------------------------- > <type 'exceptions.ArithmeticError '> Traceback (most recent call last) > > /hdc1/pablo.hdc1/sage/sage/<ipython console> in <module>() > > /hdc1/pablo.hdc1/sage/sage/integer.pyx in > integer.Integer.multiplicative_order() > > <type 'exceptions.ArithmeticError'>: no power of 3 is a unit > > (and so does for example the ring ComplexDouble) > > However, for complex numbers, things are different: (gives +infinity) > > b= 2+3*I > sage: type(b) > <type 'sage.rings.complex_number.ComplexNumber'> > sage: b.multiplicative_order() > +Infinity > > Which should be the correct behaviour? (I like more the one that answers > +infinity)
The correct behavior is +infinity, which is more useful and than an error, and is technically correct. I've made this trac #341: http://www.sagemath.org:9002/sage_trac/ticket/341 > Another problem that i've found is that calling ComplexNumber (for example > by) > > ComplexNumber(2,3) > > causes a segmentation fault. > (using sage-2.4.1.2) That's definitely a bug. It's now trac #342: http://www.sagemath.org:9002/sage_trac/ticket/342 --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/ -~----------~----~----~----~------~----~------~--~---
