Daniel061 / Sophie6.1

AI from stumbling Baby to Sentient being.
GNU General Public License v3.0
1 stars 1 forks source link

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

Open Daniel061 opened 5 years ago

Daniel061 commented 5 years ago

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.