Ari小虎鱼 发表于 2022-4-9 18:40:14

Fraction问题求助

Fraction这段代码为什么两次反馈不一样啊

from fractions import Fraction
Fraction(1708227363155544,4636617128565048)
Fraction(7, 19)

from fractions import Fraction
Fraction(1708227363155544/4636617128565048)
Fraction(6636883661388099, 18014398509481984)

Lyia 发表于 2022-12-1 15:16:51

同问同问~

kaiyong 发表于 2022-12-1 16:28:46

同问,谢谢

小甲鱼 发表于 2022-12-17 04:26:14

Fraction(1708227363155544/4636617128565048) 是相当于 Fraction(0.3684210526315789)

>>> Fraction(0.3684210526315789)
Fraction(6636883661388099, 18014398509481984)

页: [1]
查看完整版本: Fraction问题求助