Skip to content

Assert on float values #14338

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

Closed
leonkunert opened this issue May 21, 2014 · 2 comments
Closed

Assert on float values #14338

leonkunert opened this issue May 21, 2014 · 2 comments

Comments

@leonkunert
Copy link

I have a problem, where I check if two floats are equal in an assert_eq. One is returned by a function on is fix. The assert error is saying two tests have failed, with a message, that says they are the same.
I also made a gist with my code.
screen shot 2014-05-21 at 21 50 59
https://gist.github.com/leonkunert/1d07c9d2f5969e393435

@thestinger
Copy link
Contributor

The two values aren't equal, and are just being rounded for display.

1.769999999999999573674358543939888477325439453125
1.770000000000000017763568394002504646778106689453125

I opened #14339 to cover this issue.

@leonkunert
Copy link
Author

Thanks

bors added a commit to rust-lang-ci/rust that referenced this issue Mar 20, 2023
fix: Only skip adjustment hints for block, if and match expressions for reborrows

cc rust-lang/rust-analyzer#13749
flip1995 pushed a commit to flip1995/rust that referenced this issue Mar 20, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
…eturn` (rust-lang#14338)

fixes rust-lang#9911

changelog: [`blocks_in_conditions`]: don't trigger the lint when the
condition contains a `return`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants