#11779: python ints vs sage ints with respect to powers weirdness
------------------------+---------------------------------------------------
Reporter: dimpase | Owner: AlexGhitza
Type: defect | Status: needs_review
Priority: major | Milestone: sage-4.7.2
Component: coercion | Keywords:
Work_issues: | Upstream: N/A
Reviewer: | Author: Dmitrii Pasechnik
Merged: | Dependencies:
------------------------+---------------------------------------------------
Comment(by dimpase):
Replying to [comment:14 klee]:
> (Sorry for badly formated comment) I agree with leif. I think any in
`int(3)^any` should be converted to an integer n (or -n), and then
`int(3)^any` equals `int(3)` multiplied n times with itself (or numerical
inverse of `int(3)` multiplied n times with itself).
What do you mean by "numerical inverse", and why you think this is the
right precedence for operations? Leif here gives arguments based on
algebraic properties, so it should be, for algebraic consistency that he
cares about so much, that {{{int(3)^-3==int(1)/int(3)^3}}}, but this is
not the case now, as Python 2 will convert 1/27 to 0.
I advocate the rule that a binary operation involving a Sage integer and a
Python int should always produce a Sage type, as this is the case with all
the other binary operations. Do you like this?
To me, your and Leif's arguments read as "I prefer the status quo to
making Sage a more consistent system".
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/11779#comment:15>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
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-trac?hl=en.