Skip to main content
Post Undeleted by Sunitha
deleted 41 characters in body
Source Link
Sunitha
  • 12.1k
  • 2
  • 23
  • 23

This is the classic integer division problem with python2issue

In python2 temp /= 64 would perform integer division and so would result in truncated integer value. But your code would work fine. But it in python3 as the division, this would result in a floatfloat.

To fix itthe issue in python2python3, change temp /= 64 to temp //= 64.0, so that you would to force gettinginteger division and get rid of the result as a floattemp = int(temp) line

This is the classic integer division problem with python2

In python2 temp /= 64 would perform integer division and so would result in truncated integer value. But your code would work fine in python3 as the division would result in a float

To fix it in python2, change temp /= 64 to temp /= 64.0, so that you would force getting the result as a float

This is the classic integer division issue

In python2 temp /= 64 would perform integer division and so your code would work fine. But it in python3, this would result in a float.

To fix the issue in python3, change temp /= 64 to temp //= 64 to force integer division and get rid of the temp = int(temp) line

Post Deleted by Sunitha
Source Link
Sunitha
  • 12.1k
  • 2
  • 23
  • 23

This is the classic integer division problem with python2

In python2 temp /= 64 would perform integer division and so would result in truncated integer value. But your code would work fine in python3 as the division would result in a float

To fix it in python2, change temp /= 64 to temp /= 64.0, so that you would force getting the result as a float