[Issue 2297] New: on LinuxAmd64 some creal operations bring into scope a faulty version of powl

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Aug 20 09:05:04 PDT 2008


http://d.puremagic.com/issues/show_bug.cgi?id=2297

           Summary: on LinuxAmd64 some creal operations bring into scope a
                    faulty version of powl
           Product: DGCC aka GDC
           Version: unspecified
          Platform: Macintosh
        OS/Version: Linux
            Status: NEW
          Keywords: wrong-code
          Severity: normal
          Priority: P2
         Component: glue layer
        AssignedTo: dvdfrdmn at users.sf.net
        ReportedBy: fawzi at gmx.ch


{{{
module m;

version(tango)
    import tango.stdc.stdio;
else
    import std.c.stdio;
extern(C){
    real powl(real x,real y);
}

creal conj(creal z)
{
    return z.re - z.im*1i;
}

void main() {
    // with this assert on LinuxAmd64 the program writes
    //       tst 0xb.9db22d0e560418ap-5 0xf.1048380af74f336p-39
0xb.9db22d0dfbd0e1dp-5
    // instead of
    //       tst 0xb.9db22d0e560418ap-5 0xf.1048380af74f336p-39
0xb.9db22d0e560418ap-5
    assert(conj(7 + 3i) == 7-3i);
    real x = powl(1.0L-0.637L, 24);
    printf("tst %La %La %La\n", 1.0L-0.637L, x,powl(x, 1.0L/24.0L));
}
}}}


-- 



More information about the D.gnu mailing list