Bug 13052 – TypeInfo.getHash should return same hash for different floating point zeros.

Status
RESOLVED
Resolution
FIXED
Severity
major
Priority
P1
Component
druntime
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-07-06T03:32:00Z
Last change time
2015-02-18T03:38:09Z
Keywords
pull, wrong-code
Assigned to
nobody
Creator
k.hara.pg

Comments

Comment #0 by k.hara.pg — 2014-07-06T03:32:59Z
Test case: void main() { alias F = float; F f1 = +0.0, f2 = -0.0; assert(f1 !is f2); // they have different bit representations assert(f1 == f2); // but they are equal TypeInfo ti = typeid(F); assert(ti.getHash(&f1) == ti.getHash(&f2)); // if f1 and f2 are equal, their hash values should also be equal }
Comment #1 by k.hara.pg — 2014-07-06T07:19:58Z
Comment #2 by github-bugzilla — 2014-11-23T06:24:27Z
Commits pushed to master at https://github.com/D-Programming-Language/druntime https://github.com/D-Programming-Language/druntime/commit/3721b438da3a96be9918fbfaf5a56b77af4930eb fix Issue 13052 - TypeInfo.getHash should return same hash for different floating point zeros. https://github.com/D-Programming-Language/druntime/commit/652014b28c2e459360ce353ed8abdb332ab441d9 Merge pull request #867 from 9rnsr/fix13052 Issue 13052 - TypeInfo.getHash should return same hash for different floating point zeros
Comment #3 by github-bugzilla — 2015-02-18T03:38:09Z
Commits pushed to 2.067 at https://github.com/D-Programming-Language/druntime https://github.com/D-Programming-Language/druntime/commit/3721b438da3a96be9918fbfaf5a56b77af4930eb fix Issue 13052 - TypeInfo.getHash should return same hash for different floating point zeros. https://github.com/D-Programming-Language/druntime/commit/652014b28c2e459360ce353ed8abdb332ab441d9 Merge pull request #867 from 9rnsr/fix13052