On Tue, 15 Apr 2014, kcrisman wrote:

for d in range(1,8):
    for n in range(1,d):
        print n/d
0
0

Just to make it clear, range(1,7) gives Python ints, while [1..7] gives
Sage Integers.

In general one can also cast to right type and say

print Integer(n)/d

or

print 1*n/d

I guess there is no general setting to make all ints converted to Integers? As an example

L1=[1,2]; L2=[1,2,3]; print len(L1)/len(L2)

also prints 0. So does "0+len(L1)/len(L2)", whereas again "1*len(L1)/len(L2)" works as expected by most Sage users(?).

--
Jori Mäntysalo

--
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.

Reply via email to