![]() |
|
#1
|
|||
|
|||
|
Random Numbers between -0.5 to +0.5
Hi,
I want to generate random numbers between -0.5 to +0.5. I am using ran1() function, first to generate random numbers between 0.0 and 1.0. Then I subtract 0.5 from each of these random numbers and then the result is multiplied by 10. Is this trick a good one, as far as random numbers will be used for scientific purpose. If not, please let me know the better one. Or, is there any DIRECT method to generate RNs between -N to +N i.e. without "scaling thing mentioned above"? Thanks, smp |
|
#2
|
|||
|
|||
|
OK
Quote:
Quote:
Why would you want a custom version for a particular range? Regards, Dave |
![]() |
| Thread Tools | |
| Display Modes | |
|
|