1

I tried a code:

print(int((9 ** 29) + (7 ** 27)))

Answer: 4710194409608608369201743232 and

print(int(math.pow(9,29) + math.pow(7,27)))

Answer: 4710194409608608302099333120

And both gave me a different answer. Why is that?

  • It might have something to do with the fact that math.pow converts it's arguments to floats and also outputs a float. Docs: https://docs.python.org/3/library/math.html#math.pow – FissionChips Jun 29 '20 at 11:23

0 Answers0