The bug doesn't seem to be in division:

sage: Zi.<i> = ZZ.extension(x^2+1)
sage: i
1
sage: 123+456*i
579

Bruno



2014-12-19 12:14 GMT+01:00 John Cremona <john.crem...@gmail.com>:
>
> While preparing examples with Gaussian Integers for an undergraduate
> course I discovered this terrible bug:
>
> sage: Zi.<i> = ZZ.extension(x^2+1)
> sage: (123+456*i)/3
> 193
>
> I note that the type of Zi here is Order in Number Field in i with
> defining polynomial x^2 + 1 (not "maximal order" which might be the
> problem.  I was looking for the simplest way to define Z[i], the ring
> of Gaussian integers, in one line which also assignes the variable i
> and uses "i" for output, suitable for 2nd year undergraduates who do
> not know about alegbraic number fields.  So I would prefer not to do
> the following since it is supposed to be an example of a nice ring,
> not a field
>
> sage: Qi.<i> = QuadraticField(-1)
> sage: (123+456*i)/3
> 152*i + 41
>
> is fine.  But the first way should display the same, which is definitely a
> BUG.
>
> John
>
> --
> 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 http://groups.google.com/group/sage-devel.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to