On Thu, Oct 18, 2012 at 7:00 AM, Kenneth A. Ribet <[email protected]> wrote:

> Hi Sage Gurus,
>
> Am I doing something stupid here:
>
> sage: print 1/2 < 3/7
> sage: L=[]
> sage: for i in range(2,3):
> ...       for j in range(1,2):
>

Use [a..b] (or srange(a,b+1)) instead of range(a,b+1)...

William


> ...           L.append([i,j])
> ...
> sage: print L
> sage: for P in L:
> ...       print P[1], P[0]
> ...       P[1]/P[0] < 3/7
> False
> [[2, 1]]
> 1 2
> True
>
> ----
>
> In plain language:
>
> I ask sage whether 1/2 is less than 3/7, and sage tells me "false."
>
> I then create the list L = [[2,1]] and loop through L (which has only one
> element).  For P=[2,1], I ask sage whether P[1]/P[0] is less than 3/7 and
> get "true".  The conundrum is that P[1]/P[0] is 1/2, so mathematically I'm
> getting the answers "false" and then "true" for the same question.
>
> So what's going on?  I'm sure that there's a simple explanation.
>
> Thanks,
> Ken
>
> --
> You received this message because you are subscribed to the Google Groups
> "sage-support" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> Visit this group at http://groups.google.com/group/sage-support?hl=en.
>
>
>


-- 
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
Visit this group at http://groups.google.com/group/sage-support?hl=en.


Reply via email to