-
Notifications
You must be signed in to change notification settings - Fork 5.3k
BigInteger -> double fix #122207
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
BigInteger -> double fix #122207
Conversation
|
Tagging subscribers to this area: @dotnet/area-system-numerics |
huoyaoyuan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add corresponding test cases?
| ulong m = length > 1 ? bits[length - 2] : 0; | ||
| ulong l = length > 2 ? bits[length - 3] : 0; | ||
| if (length > 3 && bits.AsSpan()[..^3].ContainsAnyExcept(0u)) { | ||
| l |= 1; // sticky bit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be deciding the carrying. Can you include more description of the rule, like the soft FP methods in Half and BFloat16?
| } | ||
|
|
||
| return NumericsHelpers.GetDoubleFromParts(sign, exp, man); | ||
| // NumericsHelpers.GetDoubleFromParts does not handle rounding correctly here |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since GetDoubleFromParts is removed, the comment should be like "leverage FPU to do correct rounding for man*2^exp"
Fix #49611