Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
How can we create random number between specific range.
Let us suppose we need to generate random no. between 0.85 to 1.05, how can we do it ?
Thanks in advance.
[TenRandomNumbers]:
LOAD
Rand() * (1.05-0.85 ) + 0.85 AS myRandomNumber
AUTOGENERATE
10;
If you need it to include 1.05 exactly then add a Round()-function like this
Round( Rand() * (1.05-0.85 ) + 0.85 , 0.01) AS myRandomNumber
[TenRandomNumbers]:
LOAD
Rand() * (1.05-0.85 ) + 0.85 AS myRandomNumber
AUTOGENERATE
10;
If you need it to include 1.05 exactly then add a Round()-function like this
Round( Rand() * (1.05-0.85 ) + 0.85 , 0.01) AS myRandomNumber
Thanks a lot, it worked.