digitalmars.D.bugs - Unable to explicitly cast imaginary float to a real floating-point (dmd v0.165)
- David L. Davis (22/22) Aug 30 2006 // WinXP SP2, D v0.165
- Walter Bright (3/4) Aug 30 2006 r = ift * -1i;
- Don Clugston (3/9) Aug 30 2006 r = ift.im;
- David L. Davis (10/19) Sep 02 2006 Don thanks for pointing that out, but it has little use in templates I'm...
- David L. Davis (12/16) Sep 02 2006 Thxs for the reply Walter. But the cast(real) used to work...why exactly...
// WinXP SP2, D v0.165 // cast1.d // Unable to explicitly cast a imaginary float to a real floating-point. private import std.stdio; int main() { ifloat ift = 234.67fi; real r = cast(real)ift; writefln("ift=%gi, r=%g", ift, r); return 0; } Output: -------- C:\dmd>dmd cast1.d C:\dmd\bin\..\..\dm\bin\link.exe cast1,,,user32+kernel32/noi; C:\dmd>cast1 ift=234.67i, r=0 C:\dmd> ------------------------------------------------------------------- "Dare to reach for the Stars...Dare to Dream, Build, and Achieve!" ------------------------------------------------------------------- MKoD: http://spottedtiger.tripod.com/D_Language/D_Main_XP.html
Aug 30 2006
David L. Davis wrote:// Unable to explicitly cast a imaginary float to a real floating-point.r = ift * -1i; should do it.
Aug 30 2006
Walter Bright wrote:David L. Davis wrote:r = ift.im; also works.// Unable to explicitly cast a imaginary float to a real floating-point.r = ift * -1i; should do it.
Aug 30 2006
Don thanks for pointing that out, but it has little use in templates I'm afraid...the place where I'm having my issue at the moment. Thanks again for the reply, David L. ------------------------------------------------------------------- "Dare to reach for the Stars...Dare to Dream, Build, and Achieve!" ------------------------------------------------------------------- MKoD: http://spottedtiger.tripod.com/D_Language/D_Main_XP.html "Don Clugston" <dac nospam.com.au> wrote in message news:ed5vsk$1qad$1 digitaldaemon.com...Walter Bright wrote:David L. Davis wrote:r = ift.im; also works.// Unable to explicitly cast a imaginary float to a real floating-point.r = ift * -1i; should do it.
Sep 02 2006
Thxs for the reply Walter. But the cast(real) used to work...why exactly is the reason this doesn't now? I know you changed the implict conversion of imaginary floats so they do not work for a good reason, just unsure why the explict cast() has changed also. Thanks for your reply in advance. David L. ------------------------------------------------------------------- "Dare to reach for the Stars...Dare to Dream, Build, and Achieve!" ------------------------------------------------------------------- MKoD: http://spottedtiger.tripod.com/D_Language/D_Main_XP.html "Walter Bright" <newshound digitalmars.com> wrote in message news:ed5le5$1c1c$1 digitaldaemon.com...David L. Davis wrote:// Unable to explicitly cast a imaginary float to a real floating-point.r = ift * -1i; should do it.
Sep 02 2006