Suggestions on generating random numbers between 0 and 1

Using C, I want to generate real random numbers between 0 and 1.  Any suggestions?
mm162Asked:
Who is Participating?
 
Jan LouwerensConnect With a Mentor Software EngineerCommented:
#include <stdlib.h>
#include <time.h>

srand(time(NULL));
double randomNumber = (double)rand() / (double)RAND_MAX;
0
 
CreateObjectCommented:
Just a shot in the dark, but can't you use
the rand() function to do that?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.