www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - 108 breaks complex numbers

reply Nick <Nick_member pathlink.com> writes:
The following code fails. I think it worked in 106.

# import std.math;
# import std.stdio;
#
# void test(creal a)
# {
#   writefln(a);
# }
#
# void main()
# {
#   cdouble a = (2-2i)*(2-2i);
#
#   // This fails
#   writefln(a);
#
#   // This works
#   writefln((2-2i)*(2-2i));
#
#   // This fails
#   test((2-2i)*(2-2i));
# }

Nick
Nov 30 2004
next sibling parent "Ben Hinkle" <ben.hinkle gmail.com> writes:
"Nick" <Nick_member pathlink.com> wrote in message 
news:coi83g$1s76$1 digitaldaemon.com...
 The following code fails. I think it worked in 106.

 # import std.math;
 # import std.stdio;
 #
 # void test(creal a)
 # {
 #   writefln(a);
 # }
 #
 # void main()
 # {
 #   cdouble a = (2-2i)*(2-2i);
 #
 #   // This fails
 #   writefln(a);
 #
 #   // This works
 #   writefln((2-2i)*(2-2i));
 #
 #   // This fails
 #   test((2-2i)*(2-2i));
 # }

 Nick

you are right - it worked in 106. I'm on WinXP and my output is 0+0i 0+-8i 0+0i
Nov 30 2004
prev sibling parent reply "Walter" <newshound digitalmars.com> writes:
It never did work right. It's fixed now. Thanks.
Dec 01 2004
parent Nick <Nick_member pathlink.com> writes:
In article <cok3ec$1kim$1 digitaldaemon.com>, Walter says...
It never did work right. It's fixed now. Thanks.

I should rather be thanking you :-) Nick
Dec 02 2004