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

Fix Variant hashing for floats #74600

Merged
merged 1 commit into from
Mar 8, 2023

Conversation

AThousandShips
Copy link
Member

@AThousandShips AThousandShips commented Mar 8, 2023

Incorrectly hashed floats as single precision

Probably missed when migrating from djb2 as the function there is hash_djb2_one_float despite taking a double.

Before 1.0000000000000002 and 1.0000000000000004 would hash to the same value, now they hash differently.

The change in PACKED_FLOAT64_ARRAY might be irrelevant but added it for completeness.

Incorrectly hashed floats as single precision
@AThousandShips AThousandShips requested a review from a team as a code owner March 8, 2023 11:56
@akien-mga akien-mga added this to the 4.1 milestone Mar 8, 2023
@akien-mga akien-mga merged commit 8defa73 into godotengine:master Mar 8, 2023
@akien-mga
Copy link
Member

Thanks!

@AThousandShips
Copy link
Member Author

Thank you!

@AThousandShips AThousandShips deleted the hash_float_fix branch March 8, 2023 13:14
@YuriSizov
Copy link
Contributor

Cherry-picked for 4.0.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants