Skip to content

Fix floating-point comparison is always false warning#10

Merged
madmiraal merged 1 commit into
RebelToolbox:mainfrom
madmiraal:fix-floating-point-comparison-is-always-false
Oct 10, 2023
Merged

Fix floating-point comparison is always false warning#10
madmiraal merged 1 commit into
RebelToolbox:mainfrom
madmiraal:fix-floating-point-comparison-is-always-false

Conversation

@madmiraal
Copy link
Copy Markdown
Contributor

If a floating-point variable is compared with a constant that is not representable in the casted value, the equality will always be false.
This PR uses a float constant instead of a casted double.

@madmiraal madmiraal added the bug label Jun 19, 2023
@madmiraal madmiraal self-assigned this Jun 19, 2023
@madmiraal madmiraal merged commit d0178bb into RebelToolbox:main Oct 10, 2023
@madmiraal madmiraal deleted the fix-floating-point-comparison-is-always-false branch October 10, 2023 16:00
@madmiraal madmiraal added PR Type: Bug Fix Your current game should now work as expected. and removed bug labels May 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR Type: Bug Fix Your current game should now work as expected.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant