Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- FILE* f = fopen("/dev/urandom", "r");
- int32_t int;
- fread(&int, sizeof(int32_t), 1, f);
- fclose(f);
- double theRandomValue = int / (double) (2 ** 32 - 1);
- FILE* f = fopen("/dev/urandom", "r");
- int32_t int;
- fread(&int, sizeof(int32_t), 1, f);
- fclose(f);
- double theRandomValue = int / (double) (2 ** 32 - 1);
- #include <stdlib.h>
- printf("%fn", drand48());
- double c;
- fd = open("/dev/random", O_RDONLY);
- unsigned int a, b;
- read(fd, &a, sizeof(a));
- read(fd, &b, sizeof(b));
- if (a > b)
- c = fabs((double)b / (double)a);
- else
- c = fabs((double)a / (double)b);
Add Comment
Please, Sign In to add comment