On Sat, 15 Apr 2006, Qi Wu wrote:
Just a hint I got. The "amplitude()" seems need to be in the exact format in your example. I have tried amplitude (a +bi) does not work.

Scheme does not do arithmetic in infix. i.e. you can't to "3 + 4", you have to do (+ 3 4).

When you say "3+4i", without spaces, it is not doing arithmetic, it is the syntax for expressing a complex number...you should think of it as a single object, not as an arithmetic expression, and there cannot be spaces. So, for example, you can do
        (+ 3+4i 5+6i)
and it will give you 8.0+10.0i, but you can't do (3 + 4 i).

(The other example of expressions that look like arithmetic but are just the syntax for a number type are rational numbers: if you type "3/4" or "1/3" in Scheme, it is not a division operation, it is the expression for a rational number. Guile 1.8 supports exact rational arithmetic.)

Steven

_______________________________________________
meep-discuss mailing list
[email protected]
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss

Reply via email to