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