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

Floating Point Math Comparisons Mis-Match in Release Mode #47

Open
Daniel061 opened this issue Mar 16, 2019 · 0 comments
Open

Floating Point Math Comparisons Mis-Match in Release Mode #47

Daniel061 opened this issue Mar 16, 2019 · 0 comments
Labels
help wanted Extra attention is needed

Comments

@Daniel061
Copy link
Owner

This statement in main() "while (!(OldLevel == NewLevel)){" is never satisfied in Release mode but is in debug mode.
The statement is line number 98 in main.cpp

Both [OldLevel] and [NewLevel] are float types and are computed through division.
They are set to be not equal for the first iteration but are expected to be equal after that.

In Debug mode of compile, the operation works as expected.
In Release mode of compile, the operation never completes.

I used cout to see the two values and they are identical.

I am using Code Blocks version 17.12 with c++11 standard enabled.
My machine is Intel I7 with Windows 7 Professional OS.

Thank you for any suggestions you provide.

@Daniel061 Daniel061 added the help wanted Extra attention is needed label Mar 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant