[Issue 575] New: wrong evaluation of (creal * 2 + 1i)
Thomas Kuehne
thomas-dloop at kuehne.cn
Sat Nov 25 10:02:19 PST 2006
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
d-bugmail at puremagic.com schrieb am 2006-11-19:
> http://d.puremagic.com/issues/show_bug.cgi?id=575
> # 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
Added to DStress as
http://dstress.kuehne.cn/run/c/cfloat_11_A.d
http://dstress.kuehne.cn/run/c/cfloat_11_B.d
http://dstress.kuehne.cn/compile/c/cfloat_11_C.d
http://dstress.kuehne.cn/run/c/cdouble_11_A.d
http://dstress.kuehne.cn/run/c/cdouble_11_B.d
http://dstress.kuehne.cn/compile/c/cdouble_11_C.d
http://dstress.kuehne.cn/run/c/creal_36_A.d
http://dstress.kuehne.cn/run/c/creal_36_B.d
http://dstress.kuehne.cn/compile/c/creal_36_C.d
Thomas
-----BEGIN PGP SIGNATURE-----
iD8DBQFFaIDlLK5blCcjpWoRAhQpAKCRKaJ8vQR23fR+muEKkMwI2FaOtgCglc9x
R6C50C6danfHe7MR/SbNeLg=
=rL0l
-----END PGP SIGNATURE-----
More information about the D.gnu
mailing list