Hi Mladen!

It is not a bug. Since "range" returns Python integers (type "int")
and since 1/2 is zero for Python integers, that behaviour is expected:

sage: [type(x) for x in range(3)]
[<type 'int'>, <type 'int'>, <type 'int'>]
sage: int(1)/int(2)
0

If you want a range of Sage integers (type "Integer"), use srange:

sage: [type(x) for x in srange(3)]

[<type 'sage.rings.integer.Integer'>,
 <type 'sage.rings.integer.Integer'>,
 <type 'sage.rings.integer.Integer'>]

Cheers,
Simon

--~--~---------~--~----~------------~-------~--~----~
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-support
URL: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to