Skip to content

Conversation

@LEI-Hongfaan
Copy link
Contributor

Fix #49611

@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Dec 5, 2025
@dotnet-policy-service
Copy link
Contributor

Tagging subscribers to this area: @dotnet/area-system-numerics
See info in area-owners.md if you want to be subscribed.

Copy link
Member

@huoyaoyuan huoyaoyuan left a 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
Copy link
Member

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
Copy link
Member

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"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-System.Numerics community-contribution Indicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Conversions from BigInteger to Double are not always as precise as from Long

2 participants