Skip to content

Conversation

@aaronjeline
Copy link
Contributor

Maps currently don't preserve -0.0. If you add -0.0 as a value in a map, and read it, you will get 0.0.

This isn't true of other structures.

It happens because the default value is 0.0, and when adding a new value, the code checks if it is equal to the default value using PartialEq, which for floats treats 0.0 and -0.0 as equal.

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

Successfully merging this pull request may close these issues.

2 participants