Skip to content
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

Mono incorrectly handles nuint to floating-point conversions #69794

Closed
tannergooding opened this issue May 25, 2022 · 2 comments · Fixed by #85964
Closed

Mono incorrectly handles nuint to floating-point conversions #69794

tannergooding opened this issue May 25, 2022 · 2 comments · Fixed by #85964
Assignees
Milestone

Comments

@tannergooding
Copy link
Member

#69756 has several failures that occur across Mono:

Assert.Equal(unchecked((nuint)0xFFFF_FFFF_FFFF_F800), NumberBaseHelper<nuint>.CreateChecked<double>(+18446744073709549568.0));

Assert.Equal(unchecked((nuint)0xFFFF_FF00_0000_0000), NumberBaseHelper<nuint>.CreateChecked<float>(+18446742974197923840.0f));

In both cases the double and float used is the smallest representable double that is less than ulong.MaxValue and therefore it should always succeed.

However, Mono incorrectly throws System.OverflowException instead. The same tests exist for ulong where things are passing as expected.

@ghost ghost added the untriaged New issue has not been triaged by the area owner label May 25, 2022
@dotnet-issue-labeler
Copy link

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

@marek-safar marek-safar added this to the 7.0.0 milestone May 25, 2022
@marek-safar marek-safar added area-Codegen-JIT-mono and removed untriaged New issue has not been triaged by the area owner area-Codegen-meta-mono labels May 25, 2022
@SamMonoRT
Copy link
Member

@BrzVlad - similar to other issue, please investigate.

@BrzVlad BrzVlad modified the milestones: 7.0.0, 8.0.0 Aug 12, 2022
@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label May 9, 2023
@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label Jun 20, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Jul 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants