|
|
|
|
|
by xscott
600 days ago
|
|
It's a rule, and it behaves like people probably expect for small numbers. But following that rule: float(0.5) +
bigint(9007199254740993)
== float(9007199254740992)
I wouldn't parade it around as a triumph over the problem, and it's arguably better to require people to be explicit about whether converting the float to bigint, or the bigint to float, is what you wanted. |
|
Basically, ULP-level inaccuracy is a problem inherent to having float at all, even without bignum interactions. They would be a menace even if you had a pure tower from 32 bit int to double to complex to more.