[issue41201] Long integer arithmetic

2020-07-03 Thread Christian Heimes
Change by Christian Heimes : -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker ___ ___ Pyth

[issue41201] Long integer arithmetic

2020-07-03 Thread Rémi Lapeyre
Rémi Lapeyre added the comment: This is because you used the floating point division operator `/` instead of the integer division `//`: def digitsum(num): digsum = 0 tnum = num while tnum > 0: print("tnum = %d, digsum = %d" % (tnum,digsum)) digsum += (tnum

[issue41201] Long integer arithmetic

2020-07-03 Thread David Srebnick
New submission from David Srebnick : The following program is one way of computing the sum of digits in a number. It works properly for the first case, but fails for the second one. def digitsum(num): digsum = 0 tnum = num while tnum > 0: print("tnum = %d, digsum = %d" % (