www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 6772] New: Cannot pass cfloat argument type to a function on x86_64

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6772

           Summary: Cannot pass cfloat argument type to a function on
                    x86_64
           Product: D
           Version: D1 & D2
          Platform: x86_64
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: grahamc001uk yahoo.co.uk



---
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", n.re, n.im);
}

void main() {
    cfloat    cf;

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

}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 05 2011
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6772


Walter Bright <bugzilla digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |bugzilla digitalmars.com
         Resolution|                            |WORKSFORME



23:47:10 PST ---
This is working with the latest.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 14 2012