[Issue 575] New: wrong evaluation of (creal * 2 + 1i)

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Nov 19 14:47:07 PST 2006


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

           Summary: wrong evaluation of (creal * 2 + 1i)
           Product: GDC
           Version: 0.19
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Keywords: wrong-code
          Severity: normal
          Priority: P2
         Component: glue layer
        AssignedTo: braddr at puremagic.com
        ReportedBy: thomas-dloop at kuehne.cn


# cfloat test_f(cfloat a){
#     return a * 2 + 1i;
# }
# cdouble test_d(cdouble a){
#     return a * 2 + 1i;
# }
# creal test_r(creal a){
#     return a * 2 + 1i;
# }
# 
# import std.stdio;
# void main(){
#     cfloat f = 1.0 + 2.0i;
#     writefln("f:\t%s", f * 2 + 1i);
#     writefln("test_f:\t%s", test_f(f));
# 
#     cdouble d = 1.0 + 2.0i;
#     writefln("d:\t%s", d * 2 + 1i);
#     writefln("test_d:\t%s", test_d(d));
#     
#     creal r = 1.0 + 2.0i;
#     writefln("r:\t%s", r * 2 + 1i);
#     writefln("test_r:\t%s", test_r(r));
# 
#     writefln("direct:\t%s", (1.0 + 2.0i) * 2 + 1i);
# }

output:
> f:      3+4i
> test_f: 3+4i
> d:      3+4i
> test_d: 3+4i
> r:      3+4i
> test_r: 3+4i
> direct: 2+5i

expected output:
> f:      2+5i
> test_f: 2+5i
> d:      2+5i
> test_d: 2+5i
> r:      2+5i
> test_r: 2+5i
> direct: 2+5i


-- 




More information about the D.gnu mailing list