-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Add BFloat16 #98643
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
Add BFloat16 #98643
Conversation
Note regarding the This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change. |
Tagging subscribers to this area: @dotnet/area-system-numerics Issue DetailsCloses #96295. Delegating all functional members to float, since the upcast is trivial. The only logic is rounding from double.
|
src/libraries/System.Private.CoreLib/src/System/Number.Parsing.cs
Outdated
Show resolved
Hide resolved
The changes generally LGTM. However there are still some open comments/feedback that should be addressed (at least getting a response elaborating why it doesn't need to be handled) before this can be merged |
I should have addressed all comments, and log rounding concerns with other FP types to #112474. Interaction between For |
This one is fine to split between them or to put it entirely in
Not sure what you mean? This one should be entirely in Complex/BigInteger due to layering. |
I'm concerned about whether they should take a dependency on The relationship between other types appears to be not included in the original API review. I really suggest to avoid introducing more dependency ship for now. We may add them later. |
This would rather mainly be due to oversight.
Conversion operators are not usable in generic contexts like that, that is the reason we have
There is no additional "dependency". There is simply that we have a set of types that we ship "in box" and we want them to generally all work between eachother. That is part of the core and fundamental design of generic math. We can always provide a fallback that tries to deal with things generically, but that is expensive and rarely needed in practice since we can trivially and more cheaply just directly handle the known types. |
Is there anything to be added before being ready to merge now? |
Do we want to have performance benchmarks for this type, like https://github.com/dotnet/performance/blob/main/src/benchmarks/micro/libraries/System.Runtime/Perf.Half.cs? Opened dotnet/performance#5002 for discussion. |
Closes #96295.
Delegating all functional members to float, since the upcast is trivial. The only logic is rounding from double.
Tests are borrowed from Half.