D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 20760 - checkaction=context doesnt print floating point numbers correctly
Summary: checkaction=context doesnt print floating point numbers correctly
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: druntime (show other issues)
Version: D2
Hardware: All All
: P1 normal
Assignee: No Owner
URL:
Keywords: pull
Depends on:
Blocks:
 
Reported: 2020-04-22 13:04 UTC by moonlightsentinel
Modified: 2020-04-23 12:56 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description moonlightsentinel 2020-04-22 13:04:14 UTC
-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 Dlang Bot 2020-04-22 13:11:49 UTC
@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 Dlang Bot 2020-04-23 12:56:27 UTC
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