Ask Your Question

Revision history [back]

It is not a bug. When you write s(2), Sage preparse the 2 so that it is the Integer 2, not the Python int 2. With such Sage integers, the division leads to a Sage Rational. Now, when you use the range function, it produces Python ints, which explains your problem. If you want to generate a list of Sage Integers, you should use the srange function instead of range.

It is not a bug. When you write s(2), Sage preparse the 2 so that it is the Sage Integer 2, not the Python int 2. With such Sage integers, the division leads to a Sage Rational. Now, when you use the range function, it produces Python ints, which explains your problem. If you want to generate a list of Sage Integers, you should use the srange function instead of range.