-
Notifications
You must be signed in to change notification settings - Fork 318
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
Integer.to_decimal
and Float.to_decimal
#9716
Conversation
group_builder.specify "Float.to_decimal should attach a warning" <| | ||
Problems.expect_warning Loss_Of_Numeric_Precision (12.3 . to_decimal) |
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.
I'm wondering if the explicit conversion should still have the warning? I guess if you do it explicitly maybe it's not needed?
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.
@jdunkerley has said that because people are often unfamiliar with the fact that Float
is approximate (for example, not being able to represent 0.1 exactly), that we need these warnings always. But I think it's something we can discuss.
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.
OK, that's fair enough
Checklist
Please ensure that the following checklist has been satisfied before submitting the PR:
Scala,
Java,
and
Rust
style guides. In case you are using a language not listed above, follow the Rust style guide.
./run ide build
.