[Issue 20688] Wrong code when linking to C complex number functions

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Sep 7 05:32:11 UTC 2020


https://issues.dlang.org/show_bug.cgi?id=20688

Walter Bright <bugzilla at digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |INVALID

--- Comment #1 from Walter Bright <bugzilla at digitalmars.com> ---
The %f format is for doubles, and creal/cimag return reals. To fix:

  printf("%f+%fi\n", cast(double)creal(r), cast(double)cimag(r));

which prints:

  4.000000+0.000000i

--


More information about the Digitalmars-d-bugs mailing list