B
Bill Cunningham
I have read and studied and looked at references and can't find out how
to do this. Here's where some real knowledge comes in now lets see who in
clc really knows there stuff
main(void) {
srand(time(NULL));
printf("%i\\n",rand());
return 0;
Simple and forward now here's where I'm stumped. I want the random values
returned in the above way to be long doubles and the equivalent of
pow(2,128). But srand takes an unsigned 32 bit on my system and long double
is 96 bit on my system, or 12 bytes. I can find no conversion functions and
I don't know if I need casts. Can srand return random values of 2 to the 128
power? I know this can be done. Someone please show me.
Thanks
to do this. Here's where some real knowledge comes in now lets see who in
clc really knows there stuff
main(void) {
srand(time(NULL));
printf("%i\\n",rand());
return 0;
Simple and forward now here's where I'm stumped. I want the random values
returned in the above way to be long doubles and the equivalent of
pow(2,128). But srand takes an unsigned 32 bit on my system and long double
is 96 bit on my system, or 12 bytes. I can find no conversion functions and
I don't know if I need casts. Can srand return random values of 2 to the 128
power? I know this can be done. Someone please show me.
Thanks