News for hackers. Stuff that matters.
Re:Go 1.21 may have a clear(x) builtin by jeroenhd on Sunday November 20, 2022 @07:34AM (#33680428)
Floating point numbers are nothing more than bits with context. They're not some kind of super special construct that only dedicated hardware can operate on. They have their own modification instructions so they incorporate the float standard, but that standard is only relevant when you're operating on numbers.

In my opinion, language native hash maps should operate on memory, not on types and their weird implementations. Negative zero and positive zero are defined as different values but are mathematically equal; however, math functions may (and in the case of C, do) behave differently depending on which one you use. Even in higher level languages such as Java sorting gets affected by the presence of negative and positive zero using min/max operators.

If two values claim equality but do effectively alter program behaviour, I consider their equality operation in the context of memory operations such as hash maps to be buggy. There are good reasons to rely on the equality operators, but I do not think such behaviour should be the default.

There are no comments on this comment yet.