Thread overview
ifloat/idouble/ireal and .im/.re
Nov 12, 2005
Thomas Kuehne
Nov 13, 2005
Walter Bright
Nov 13, 2005
Thomas Kuehne
November 12, 2005
ifloat a = 1.0i;
assert(a.im == 1.0);

const ifloat b = 2.0i;
static assert(a.im == 2.0i); // FAIL

Added to DStress as http://dstress.kuehne.cn/run/i/idouble_04_A.d http://dstress.kuehne.cn/run/i/idouble_04_B.d http://dstress.kuehne.cn/run/i/ifloat_05_A.d http://dstress.kuehne.cn/run/i/ifloat_05_B.d http://dstress.kuehne.cn/run/i/ireal_05_A.d http://dstress.kuehne.cn/run/i/ireal_05_B.d

Thomas

November 13, 2005
"Thomas Kuehne" <thomas-dloop@kuehne.cn> wrote in message news:tk-18a2189c960032901deaef67@birke.kuehne.cn...
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> ifloat a = 1.0i;
> assert(a.im == 1.0);
>
> const ifloat b = 2.0i;
> static assert(a.im == 2.0i); // FAIL

I think you meant b.im. In any case, the .im property returns the imaginary part as a real, not as an imaginary, float.

>
> Added to DStress as http://dstress.kuehne.cn/run/i/idouble_04_A.d http://dstress.kuehne.cn/run/i/idouble_04_B.d http://dstress.kuehne.cn/run/i/ifloat_05_A.d http://dstress.kuehne.cn/run/i/ifloat_05_B.d http://dstress.kuehne.cn/run/i/ireal_05_A.d http://dstress.kuehne.cn/run/i/ireal_05_B.d
>
> Thomas
>
> -----BEGIN PGP SIGNATURE-----
>
> iD8DBQFDdj0Q3w+/yD4P9tIRAjJ5AKCzMlMs4hWkEWqARSkt0AeC5aZCCwCghzaI
> 9dH9MtFBizkeoKNQcrMdfuQ=
> =xr5R
> -----END PGP SIGNATURE-----


November 13, 2005
Walter Bright schrieb am 2005-11-13:
>
> "Thomas Kuehne" <thomas-dloop@kuehne.cn> wrote in message news:tk-18a2189c960032901deaef67@birke.kuehne.cn...
>>
>> ifloat a = 1.0i;
>> assert(a.im == 1.0);
>>
>> const ifloat b = 2.0i;
>> static assert(a.im == 2.0i); // FAIL
>
> I think you meant b.im. In any case, the .im property returns the imaginary part as a real, not as an imaginary, float.

Yes, the content of the message was incorrect, whereas the test cases look sane.

const ifloat b = 2.0i;
static assert(b.im == 2.0);

Thomas