On Tue, Apr 15, 2014 at 4:53 PM, Bassie <[email protected]> wrote:
> I'm running a double for loop, and dividing one over the other. Sagecloud
> converts these fractions to 0, just like python2, but isn't it exactly what
> it's not supposed to do.
> """
> for d in range(1,8):
> for n in range(1,d):
> print n/d
> 0
> 0
> 0
> 0
> 0
> 0
> 0
> 0
> etc.
> """
Sage only converts integer literals. You need to do
for d in [1..7]:
for n in [1..d-1]:
print n/d
or
for d in srange(1,8):
for n in srange(1,d):
print n/d
>
> --
> 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.
--
William Stein
Professor of Mathematics
University of Washington
http://wstein.org
--
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.