| Well, now you've got to get along, you've both provided the same
solution in the end. Thankyou both for your time. (next project is for
me to develope some math skills!).
Paul Ruston (don't worry, I sensed the sarcasm in your mail to Erik)
>-----Original Message-----
>From: jp [SMTP:pichejnospam@ERE.UMontreal.CA]
>Sent: July 16, 1998 2:35 PM
>To: Ruston, Paul
>Cc: 'Erik_Spjut@HMC.Edu'; 'Csound group'
>Subject: Re: RANDOM NUMBERS
>
>Paul,
>
>There is no antagonism whatsoever! I just have a weird sense of humour. The
>fact
>is I very much appreciate Erik's input on the list... but then I like to poke
>fun at myself and other occasionaly , specially when they are as sharp as
>Erik!
>But HOT DAMN!!!>>> my solution does not work!!!! it DOES produce zeros... I
>was
>misguided by the display when checking... This one here seems to work:
>
>k1 rand 1
>k2 = 2*int(k1+1)-1
>
>and thats almost the same as Erik's!
>
>> I hope I'm not displaying my ignorance here or encouraging the
>> antagonism between the two of you but doesn't Jean Piche's formula
>> produce -1's and 0's instead of -1's and +1's ?
>>
>> k1 rand 1
>> k2 = int(k1+1)-1
>>
>> What do you think of these suggestions? Is one better than the other?
>> (variations of Erik Spjut's suggestion)
>>
>> k1 rnd(1)
>> k2=2*int(2*k1)-1
>>
>> or
>>
>> k1 rand 1
>> k2 = 2*int(2*abs(k1))-1
>>
>> And I apologize. I am one of those that does not fully understand the
>> random functions (but I'm working on it). Thanks again.
>
>--
>________________________________________________________
>Jean Piche
>Universite de Montreal
>http://mistral.ere.umontreal.ca/~pichej |