rand.c\prng\src - musl - musl - an implementation of the standard library for Linux-based systems

index : musl
musl - an implementation of the standard library for Linux-based systems
summary refs log tree commit diff
path: root/src/prng/rand.c
blob: c000cd248cef667bab257940768616c9349f7d70 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include <stdlib.h>
#include <stdint.h>
static uint64_t seed;
void srand(unsigned s)
{
	seed = s-1;
}
int rand(void)
{
	seed = 6364136223846793005ULL*seed + 1;
	return seed>>33;
}
generated by cgit v1.2.1 (git 2.18.0) at 2025年09月05日 22:09:11 +0000

AltStyle によって変換されたページ (->オリジナル) /