Summary: Cannot pass cfloat argument type to a function on
           Product: D
           Version: D1 & D2
          Platform: x86_64
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD

--- Comment #0 from Graham <> 2011-10-05 13:32:18 PDT 
In the example below the function gets a different value for argument n than
value passed cf.

Argument type and size is OK, but value is wrong.

Both D1 and D2 have this problem. Problem only present for 64 bit code.

import std.stdio;

void myfunc(cfloat n) {
    writefln("argument type is %s", typeof(n).stringof);
    writefln("n = 0x%X, sizeof = %d", *(cast(ulong*)&n), n.sizeof);
    writefln("real part %f, imag part %f",,;

void main() {
    cfloat    cf;

    cf = 1.02f+3.04fi;
    writefln("cf = 0x%X, sizeof = %d", *(cast(ulong*)&cf), cf.sizeof);


Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to