hi,
the inbuilt function rand() generates a large integer that i hav to use rand()%x to get a number 0 & x including 0.
how do i generate a number a > 0 and < 1 using the rand function. i knew its not that difficult, either divide the rand() by a number larger.. or divide by another rand() by checking if its greater than the first number generated. but i wanted to know if there is any inbuilt command or any other better algorithm for generating. thk u.
/legolas
the inbuilt function rand() generates a large integer that i hav to use rand()%x to get a number 0 & x including 0.
how do i generate a number a > 0 and < 1 using the rand function. i knew its not that difficult, either divide the rand() by a number larger.. or divide by another rand() by checking if its greater than the first number generated. but i wanted to know if there is any inbuilt command or any other better algorithm for generating. thk u.
/legolas