digitalmars.D - a complex question
- dennis luehring (12/12) Nov 19 2005 why can't i write something like this
- Tomás Rossi (3/14) Nov 19 2005 The precious '#' symbol? No, that looks UGLY man!
- dennis luehring (5/6) Nov 19 2005 other ideas to solve the problem or syntax changes
- Walter Bright (6/11) Nov 19 2005 cfloat c = 1*b + (a*5i);
- dennis luehring (3/4) Nov 19 2005 sorry i can use 1i
- Manfred Nowak (6/8) Nov 19 2005 Why is it so bad to write the usual
- dennis luehring (1/1) Nov 19 2005 im so stupid , thank your
- David L. Davis (55/67) Nov 19 2005 It can be done with a small change, see your code modified below:
why can't i write something like this float a; float b; a = do_something(a); b = do_something(b); cfloat c = (1+b) + (3*a)i or cfloat c = (1+do_something(a)) + (3 * do_something(b))i; ok i know it is a syntax problem - but why? maybe with a new syntax? cfloat c = (1+b) + (3*a)#i ciao dennis
Nov 19 2005
In article <dlnkoi$knk$1 digitaldaemon.com>, dennis luehring says...why can't i write something like this float a; float b; a = do_something(a); b = do_something(b); cfloat c = (1+b) + (3*a)i or cfloat c = (1+do_something(a)) + (3 * do_something(b))i; ok i know it is a syntax problem - but why? maybe with a new syntax? cfloat c = (1+b) + (3*a)#iTom
Nov 19 2005
other ideas to solve the problem or syntax changes cfloat c = 1*b + (a*5)i // or do nobody need this (a*5)i thing (im not an complex pro. :-)) how can i write this in d (in an clear and handy way) ciao dennis
Nov 19 2005
"dennis luehring" <dl.soluz gmx.net> wrote in message news:dlnmr9$mu4$1 digitaldaemon.com...cfloat c = 1*b + (a*5i); cfloat c = 1*b + (a*5)*1i; ifloat i = 1i; cfloat c = 1*b + (a*5)*i;other ideas to solve the problem or syntax changes cfloat c = 1*b + (a*5)i // or do nobody need this (a*5)i thing (im not an complex pro. :-)) how can i write this in d (in an clear and handy way)
Nov 19 2005
sorry i can use 1i cfloat c = 1 + (2*3)*1i; cioa dennis
Nov 19 2005
dennis luehring wrote: [...]maybe with a new syntax? cfloat c = (1+b) + (3*a)#iWhy is it so bad to write the usual cfloat c = (1+b) + (3*a)*1i ??? -manfred
Nov 19 2005
In article <dlnkoi$knk$1 digitaldaemon.com>, dennis luehring says...why can't i write something like this float a; float b; a = do_something(a); b = do_something(b); cfloat c = (1+b) + (3*a)i or cfloat c = (1+do_something(a)) + (3 * do_something(b))i; ok i know it is a syntax problem - but why? maybe with a new syntax? cfloat c = (1+b) + (3*a)#i ciao dennisIt can be done with a small change, see your code modified below: Output: ------------------------- C:\dmd>dmd floattest2.d C:\dmd\bin\..\..\dm\bin\link.exe floattest2,,,user32+kernel32/noi; C:\dmd>floattest2 c = (1 + b) + (3 * a) * 1.0fi; a=1.50, b=1.50, c=2.5+4.5i c = (1 + do_something(a)) + (3 * do_something(b)) * 1.0fi; do_something(a)=1.50, do_something(b)=1.50, c=2.5+4.5i C:\dmd> Hope you find this sample code useful, 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
Nov 19 2005