mirror of
https://github.com/fluencelabs/musl
synced 2025-07-02 16:12:02 +00:00
14 lines
171 B
C
14 lines
171 B
C
![]() |
#include <stdlib.h>
|
||
|
|
||
|
static unsigned seed;
|
||
|
|
||
|
void srand(unsigned s)
|
||
|
{
|
||
|
seed = s-1;
|
||
|
}
|
||
|
|
||
|
int rand(void)
|
||
|
{
|
||
|
return (seed = (seed+1) * 1103515245 + 12345 - 1)+1 & 0x7fffffff;
|
||
|
}
|