Bug 20760 – checkaction=context doesnt print floating point numbers correctly

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
druntime
Product
D
Version
D2
Platform
All
OS
All
Creation time
2020-04-22T13:04:14Z
Last change time
2020-04-23T12:56:27Z
Keywords
pull
Assigned to
No Owner
Creator
moonlightsentinel

Comments

Comment #0 by moonlightsentinel — 2020-04-22T13:04:14Z
-checkaction=context doesnt handle real some imaginary/complex types correctly, e.g. ==================================================== assert(real(1) == real(-1)); // 1.76015e-312 != 1.76015e-312 assert(ifloat.max == -ifloat.max); // 3.40282e+38 != -3.40282e+38, missing i assert(idouble.max == -idouble.max); // 1.79769e+308 != -1.79769e+308, missing i assert(ireal(1i) == ireal(-1i)); // 8.37038e-314 != 8.37038e-314 assert(creal(1 + 2i) == creal(-1 + 2i)); // 1.41579e-312 + 1.41579e-312i != 1.41579e-312 + 1.41579e-312i ==================================================== Tested on Win64 using current master
Comment #1 by dlang-bot — 2020-04-22T13:11:49Z
@MoonlightSentinel created dlang/druntime pull request #3058 "Fix Issue 20760 - checkaction=context doesnt print floating point num…" fixing this issue: - Fix Issue 20760 - checkaction=context doesnt print floating point numbers correctly This fixes most issues allthough casting from real to c_long_double might be problematic for platforms where D's real uses 80 bits but C's long double is only 64 bit wide (e.g. Win64). https://github.com/dlang/druntime/pull/3058
Comment #2 by dlang-bot — 2020-04-23T12:56:27Z
dlang/druntime pull request #3058 "Fix Issue 20760 - checkaction=context doesnt print floating point num…" was merged into master: - 8134855a24b09e89ebe12012f85b3deee947ee96 by MoonlightSentinel: Fix Issue 20760 - checkaction=context doesnt print floating point numbers correctly This fixes most issues allthough casting from real to c_long_double might be problematic for platforms where D's real uses 80 bits but C's long double is only 64 bit wide (e.g. Win64). https://github.com/dlang/druntime/pull/3058