[Issue 730] broken operator handling of ifloat/idouble/ireal

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Nov 1 00:54:00 PDT 2007


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


clugdbug at yahoo.com.au changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|INVALID                     |




------- Comment #3 from clugdbug at yahoo.com.au  2007-11-01 02:54 -------
(In reply to comment #2)
> It's not illegal. The mathematical result is 0, which is what is assigned to f.

The imaginary part of the expression is indeed 0. But that involves an implicit
cast from double to idouble, which is very hard to justify. The type of (1.0i *
2.0i) is double. It's not even a cdouble.

The current behaviour violates
a *= b  <---> a = a*b, since the latter won't compile.

idouble *= idouble  is a bug in user code, 100% of the time.

(I actually got bitten by this, when I wrote generic dot product code. You
can't assume that a = a*a compiles).


-- 



More information about the Digitalmars-d-bugs mailing list