rand.c (183B)
1 #include <stdlib.h> 2 #include <stdint.h> 3 4 static uint64_t seed; 5 6 void srand(unsigned s) { 7 seed = s-1; 8 } 9 10 int rand(void) { 11 seed = 6364136223846793005ULL*seed + 1; 12 return seed>>33; 13 }
matter.cCross-platform minimalist libc | |
| git clone git://git.finwo.net/lib/matter.c | |
| Log | Files | Refs | README | LICENSE |