Revision history [back]

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

 3 None John Palmieri 6582 ●18 ●57 ●146 http://www.math.washin...

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 00
1 divided by 3 is equal to 1/31/3
2 divided by 3 is equal to 2/32/3
[0, 1, 2]
0 divided by 3 is equal to 00
1 divided by 3 is equal to 00
2 divided by 3 is equal to 00


Greetings

-A