← Back to index
|
Original Bugzilla link
Bug 715 – incorrect IEEE 754 handling of -0i and +0i
Status
RESOLVED
Resolution
INVALID
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
Linux
Creation time
2006-12-22T07:23:00Z
Last change time
2014-02-15T13:21:46Z
Assigned to
bugzilla
Creator
thomas-dloop
Comments
Comment #0
by thomas-dloop — 2006-12-22T07:23:43Z
# # union F{ # float f; # uint i; # } # # union I{ # ifloat f; # uint i; # } # # void foo(){ # // success with "float" # F f; # f.f = 0.0f; # f.f *= -1.0f; # assert(f.i == 0x80000000); # # // failure with "ifloat" # I i; # i.f = 0.0fi; # i.f *= -1.0fi; # assert(i.i == 0x80000000); # } # test cases:
http://dstress.kuehne.cn/run/ieee_754_zerosdq_01.d
http://dstress.kuehne.cn/run/ieee_754_zerosdq_02.d
http://dstress.kuehne.cn/run/ieee_754_zerosdq_03.d
http://dstress.kuehne.cn/run/ieee_754_zerosdq_04.d
Comment #1
by aldacron — 2006-12-23T02:15:17Z
This creates a real, not an imaginary. It shouldn't compile at all. > # union I{ > # ifloat f; > # uint i; > # } > # > # void foo(){ > # I i; > # i.f = 0.0fi; > # i.f *= -1.0fi; << This should be i.f *= -1.0f; > # assert(i.i == 0x80000000); > # }
Comment #2
by thomas-dloop — 2006-12-23T07:13:29Z
Thanks for catching this. I've fixed the test cases and refiled the issue as #730