X-Git-Url: https://jasonwoof.com/gitweb/?p=vor.git;a=blobdiff_plain;f=mt.c;h=816de6e197e0523f0d4309773aed15e570b7add7;hp=ff3a7c994dfe881ace45162468b3e9a469f3e6eb;hb=HEAD;hpb=841f94c4182f8dff0253db9bae4922c3c9039a5f diff --git a/mt.c b/mt.c index ff3a7c9..816de6e 100644 --- a/mt.c +++ b/mt.c @@ -1,6 +1,9 @@ /* mt.c - A C program for MT199937, with initialization improved 2002-02-10. ----- + 2006-01-14 - Switched include from stdint.h to inttypes.h, + fixed a warning from gcc -Wall. --Josh + ----- 2003-07-01 - Stripped out stuff I didn't need, converted to stdint.h types, changed source formatting a bit. --Josh ----- @@ -125,11 +128,11 @@ urnd(void) float frnd(void) { - return urnd()/(float)0x100000000UL; + return urnd()/(1.0 + UINT32_MAX); } float crnd(void) { - return (urnd()-0x80000000)/(float)0x100000000UL; + return (urnd()-INT32_MIN)/(1.0 + UINT32_MAX); }