Re: [SOLVED] Cool python script
Reply #21 –
might be because
print("is 0.1+0.2 equal to 0.3")
print (0.1+0.2==0.3)
print("=================")
print("9999999999999999.0-9999999999999998.0=",9999999999999999.0-9999999999999998.0)
print ("================")
print ("what the hell??????")
#this mistake cause by binary system that defined by IEEE754
#you can read about it in (https://en.wikipedia.org/wiki/IEEE_754?wprov=sfla1)
or might not be
for example:
import math
result = math.factorial(94) / math.factorial(82)
print(result)
gives:
2.287437402361021e+23
that is equal to:
228743740236102111330304
so you see there's no problem with code, but with python itself (or all PL in general)
this might come handy if you want to fix this: percition py
the question is, are you willing to rewrite the code in this library