smp

05-25-2010, 06:37 AM

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.

Thanks,

smp

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.

Thanks,

smp