+ 1
Why is different ??
a = 9**16 == int(float(9**16)) b = 9**17 == int(float(9**17)) print (a) print (b) https://code.sololearn.com/cm7U8i3B0SSf/?ref=app
1 Odpowiedź
+ 5
Floating-point numbers are represented with certain precision only. For most cases this doesn't make a difference, but for large-scale operations like exponentiation, it might be off to some extent.
Read more:
https://en.m.wikipedia.org/wiki/Floating-point_arithmetic#Accuracy_problems