Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
[stdlib] Change documented behavior of FloatingPoint.significand #26390
A seemingly innocuous but actually nontrivial change.
In SE-0067, the intended behavior of
However, the actual behavior of
Float.infinity.significand // +inf Double.infinity.significand // +inf // (etc.)
To align the actual behavior with the intended one would have been easy enough before ABI stability: the branch for finite normal values works just fine for infinite values in producing the desired result. However, the function is
On the other hand, it's perfectly defensible for infinite values to have an infinite significand. The documentation currently states:
With the current actual behavior, we can make another guarantee: for infinite, zero, or NaN values, the significand is not in the range
In any case, we've got to reconcile the documented behavior with the actual behavior one way or another.