Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Bug: sometimes the quotient of integers gives zero

In the following code (See https://sagecell.sagemath.org/?q=cctcfj ):

` a=[4,5,6]

b=[0,1,2]

for i in zip([0,1,2],a):

print i[0],"divided by",len(a),"is equal to",i[0]/len(a)

a=[4,5,6]

b=range(len(a))

print(b)

for i in zip(b,a):

print i[0],"divided by",len(a),"is equal to",i[0]/len(a)

` Gives the following output 0 divided by 3 is equal to 0

1 divided by 3 is equal to 1/3

2 divided by 3 is equal to 2/3

[0, 1, 2] 0 divided by 3 is equal to 0

1 divided by 3 is equal to 0

2 divided by 3 is equal to 0

Greetings

-A

Bug: sometimes the quotient of integers gives zero

In the following code (See https://sagecell.sagemath.org/?q=cctcfj ):

` a=[4,5,6]

b=[0,1,2]

for i in zip([0,1,2],a):

print i[0],"divided by",len(a),"is equal to",i[0]/len(a)

a=[4,5,6]

b=range(len(a))

print(b)

for i in zip(b,a):

print i[0],"divided by",len(a),"is equal to",i[0]/len(a)

` Gives the following output 0 divided by 3 is equal to 0

1 divided by 3 is equal to 1/3

2 divided by 3 is equal to 2/3

[0, 1, 2] 0 divided by 3 is equal to 0

1 divided by 3 is equal to 0

2 divided by 3 is equal to 0

Greetings

-A

Bug: sometimes Request: Have the quotient len function output a Sage Integer instead of integers gives zeroa Python int

In the following code (See https://sagecell.sagemath.org/?q=cctcfj ):

` a=[4,5,6]

a=[4,5,6]
 b=[0,1,2]
 

b=[0,1,2]

for i in zip([0,1,2],a):

zip([0,1,2],a): print i[0],"divided by",len(a),"is equal to",i[0]/len(a)
a=[4,5,6]

b=range(len(a))

print(b)

for i in zip(b,a):

    print i[0],"divided by",len(a),"is equal to",i[0]/len(a)

a=[4,5,6]

b=range(len(a))

print(b)

for i in zip(b,a):Gives the following output

print i[0],"divided by",len(a),"is equal to",i[0]/len(a)

` Gives the following output 0 divided by 3 is equal to 0

0

1 divided by 3 is equal to 1/3

1/3

2 divided by 3 is equal to 2/3

2/3

[0, 1, 2] 0 divided by 3 is equal to 0

0

1 divided by 3 is equal to 0

0

2 divided by 3 is equal to 0

0

Greetings

-A