#8230: strange behaviour
------------------------+---------------------------------------------------
Reporter: zimmerma | Owner: robertwb
Type: defect | Status: new
Priority: major | Milestone: sage-4.3.3
Component: coercion | Keywords:
Author: | Upstream: N/A
Reviewer: | Merged:
Work_issues: |
------------------------+---------------------------------------------------
Hi, I found the following strange behaviour of the addition
<int> + 1/2. I have a file {{{MurphyE.sage}}} which contains:
{{{
load E.sage
foo(2)
}}}
where {{{E.sage}}} contains:
{{{
def foo(K):
for i in range(K):
print i, i+1/2, type(i), type(i+1/2)
}}}
Then I get:
{{{
sage: load MurphyE.sage
0 0 <type 'int'> <type 'int'>
1 1 <type 'int'> <type 'int'>
}}}
Now if instead I replace {{{load E.sage}}} in my file by the
content of the procedure {{{foo}}}, i.e.:
{{{
def foo(K):
for i in range(K):
print i, i+1/2, type(i), type(i+1/2)
foo(2)
}}}
then I get:
{{{
sage: load MurphyE.sage
0 1/2 <type 'int'> <type 'sage.rings.rational.Rational'>
1 3/2 <type 'int'> <type 'sage.rings.rational.Rational'>
}}}
which is the expected behaviour. Please can someone explain to me
the first result? I forgot to say it is with Sage 4.3.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/8230>
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.