☰
Debian Codegraph
@
0.0~git20260129.ec0effd-3
0.0~git20260129.ec0effd-2
/
/
libc-top-half
/
musl
/
src
/
prng
/
rand.c
☽
☼
libc-top-half/musl/src/prng/rand.c
code
plain
raw
MIT
2005-2019 Rich Felker <
[email protected]
>; 2005-2019 Many other contributors
debian/copyright
1
#include <stdlib.h>
2
#include <stdint.h>
3
4
static uint64_t seed;
5
6
void srand(unsigned s)
7
{
8
seed = s-1;
9
}
10
11
int rand(void)
12
{
13
seed = 6364136223846793005ULL*seed + 1;
14
return seed>>33;
15
}