Jul-02-2019, 08:24 PM
my point is that both 245850922/78256779 and 884279719003555/281474976710656 give an accurate value of Pi, as precise as double type (53 bit mantissa on x86) can hold. the 2nd one is what float.as_integer_ratio() returns, but the 1st ratio is a better one because it is the smallest that can give a ratio that good. apparent float.as_integer_ratio() just uses power of two scaling. 281474976710656 == 2**48. it probably just scales the float value up until it is a whole number without any fractional part and includes the corresponding power of 2 in the tuple.
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.