add and use internal header for *rand48 lcg

This commit is contained in:
Rich Felker 2018-09-07 23:02:40 -04:00
parent 01294da7f7
commit f9db9eca40
8 changed files with 12 additions and 13 deletions

View File

@ -1,4 +1,5 @@
#include <stdint.h>
#include "rand48.h"
uint64_t __rand48_step(unsigned short *xi, unsigned short *lc)
{

View File

@ -1 +1,3 @@
#include "rand48.h"
unsigned short __seed48[7] = { 0, 0, 0, 0xe66d, 0xdeec, 0x5, 0xb };

View File

@ -1,8 +1,6 @@
#include <stdlib.h>
#include <inttypes.h>
uint64_t __rand48_step(unsigned short *xi, unsigned short *lc);
extern unsigned short __seed48[7];
#include "rand48.h"
double erand48(unsigned short s[3])
{

View File

@ -1,7 +1,6 @@
#include <stdlib.h>
#include <string.h>
extern unsigned short __seed48[7];
#include "rand48.h"
void lcong48(unsigned short p[7])
{

View File

@ -1,8 +1,6 @@
#include <stdlib.h>
#include <inttypes.h>
uint64_t __rand48_step(unsigned short *xi, unsigned short *lc);
extern unsigned short __seed48[7];
#include "rand48.h"
long nrand48(unsigned short s[3])
{

View File

@ -1,8 +1,6 @@
#include <stdlib.h>
#include <inttypes.h>
uint64_t __rand48_step(unsigned short *xi, unsigned short *lc);
extern unsigned short __seed48[7];
#include "rand48.h"
long jrand48(unsigned short s[3])
{

4
src/prng/rand48.h Normal file
View File

@ -0,0 +1,4 @@
#include <stdint.h>
uint64_t __rand48_step(unsigned short *xi, unsigned short *lc);
extern unsigned short __seed48[7];

View File

@ -1,7 +1,6 @@
#include <stdlib.h>
#include <string.h>
extern unsigned short __seed48[7];
#include "rand48.h"
unsigned short *seed48(unsigned short *s)
{