下面为什么会出现不一样呀的结果(python)
>>> print(Fraction(1708227363155544, 4636617128565048))7/19
>>> print(Fraction(1708227363155544/4636617128565048))
6636883661388099/18014398509481984 因为你 1708227363155544/4636617128565048 就直接运算了整个算式的值,而计算机无法精确地存储浮点数 Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
print(Fraction(1708227363155544, 4636617128565048))
NameError: name 'Fraction' is not defined
??
页:
[1]