On Fri, Oct 16, 2009 at 3:18 PM, mb <[email protected]> wrote:
>
> Hi,
>
> I think the following is a bug. Most of the time 1/2 is not declared
> to be 0, but it is in the following code:
>
> In [1]: L=[]
> In [2]: for a in range
> (1,2):
> ....: for b in range
> (2,3):
> ....: L.append
> ([a,b])
> ....:
> In [3]:
> L
> Out[3]: [[1, 2]]
> In [4]: for item in
> L:
> ....: print item[0]/item
> [1]
> ....:
> 0
>
> This is sage 4.1.1 on GNU/Linux.
>
In Sage you can do:
sage: (1..10)
<generator object ellipsis_iter at 0x10ac32fa0>
sage: [1..10]
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
and you won't get python ints. Also, you can do your calculation above:
L=[]
for a in (1..1):
for b in (2..2):
L.append([a,b])
print L
for item in L:
print item[0]/item[1]
William
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---