БГ
Работает
Size: a a a
БГ
БГ
БГ
py3
from math import sqrt, pi
print(sqrt(pi**2)==pi)
True
БГ
P
SI
SI
БГ
py3
from os import urandom
from math import sqrt
i = int.from_bytes(urandom(100), 'big')
print(sqrt(i**2)==i)
Traceback (most recent call last):
File "source_file.py", line 4, in <module>
print(sqrt(i**2)==i)
OverflowError: int too large to convert to float
P
БГ
ЮЧ
py3
from math import sqrt
print((sqrt(7)**2)==7)
False
БГ
py3
from math import sqrt
print((sqrt(7)**2)==7)
False
ЮЧ
py3
from math import sqrt, pi
print((sqrt(pi)**2)==pi)
False
P
py3
from math import sqrt
print((sqrt(7)**2)==7)
False
БГ
py3
print ("let me show you a hurt of floating point numbers\n\n")
print(".1*.1*.1+.00001 = {}\n\n".format(.1*.1*.1+.00001))
print("0.2+0.1==0.3:\n{}".format (0.2+0.1==0.3))
let me show you a hurt of floating point numbers
.1*.1*.1+.00001 = 0.0010100000000000003
0.2+0.1==0.3:
False
ЮЧ
P
P
БГ