[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


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:



More information about the Digitalmars-d-bugs mailing list