Mixed mode __complex__ arithmetic
Paolo Carlini
paolo.carlini@oracle.com
Sat Sep 18 13:36:00 GMT 2010
On 09/16/2010 05:26 PM, Joseph S. Myers wrote:
> I am not aware of any problems. The complex float value will be converted
> to complex double as required by C99.
>
Thanks Joseph, good to now. For your curiosity, I was trying to change
the code like this:
Index: complex
===================================================================
--- complex (revision 164337)
+++ complex (working copy)
@@ -1132,10 +1132,7 @@
complex&
operator*=(const complex<_Tp>& __z)
{
- _ComplexT __t;
- __real__ __t = __z.real();
- __imag__ __t = __z.imag();
- _M_value *= __t;
+ _M_value *= __z.__rep();
return *this;
}
but unfortunately I can't really do it, because _Tp can be != floating
point type. For floating point types it would work.
Paolo.
More information about the Gcc
mailing list