| Victor, my meaning is more like your second statement -- "wherever a number
is permissible" -- because there are other things that can occur in these
places too (the @ operator, parantheses). Thanks, I will try to clarify the
sentence and perhaps provide an example.
Regarding precedence and order of evalution: I have done a few more tests,
and of course for expressions like [ 8 / 2 / 2 ] and [ 4 + 3 - 2 + 1 ], the
order of evaluation is left to right (giving 2 and 6). However, for
expressions like the following, I seem to be getting right-to-left
evaluation:
[ 2 * 2 & 3 ] ; gives 4, not 0
[ 3 & 2 * 2 ] ; gives 0, not 4
[ 4 | 3 * 3 ] ; gives 13, not 21
[ 3 * 1 & 3 * 3 & 3 * 7 ] ; gives 3, not 7
So, it appears that & and | have the same precedence as * but then the whole
expression is evaluated in reverse? Can anyone make some sense of this so
that I can describe it correctly?
Thanks.
Anthony
Victor.Lazzarini@nuim.ie wrote on 1/29/08 5:04 PM:
> The paragraph on tilde ~ is not very clear, I am not
> sure what the text implies. Would it be something
> like
> "The tilde symbol can be used anywhere in an expression
> in place of a number..."
> or
> "...can be used in an expression
> wherever a number is permissible, to provide..."
>
> Victor
>
> ----- Original Message -----
> From: Anthony Kozar
> Date: Tuesday, January 29, 2008 9:59 pm
> Subject: [Cs-dev] Score expressions
> To: New Csound Developer list
>> Note that operations of the same
>> precedence are evaluated from right to left, not the usual left
>> to right.
>> The logical operators have the same precedence
>> as the *, /, and
>> % arithmetic operators.
>> Finally, the tilde symbol ~ can be used
>> anywhere in an expression that a
>> number is permissible to provide a random value between zero (0)
>> and one (1).
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net |