repo.or.cz
/
musl.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
riscv32: add arch headers
[musl.git]
/
src
/
prng
/
drand48.c
blob
08283e240b14fad45921469bc7aea39eadda3670
1
#include <stdlib.h>
2
#include <inttypes.h>
3
#include
"rand48.h"
4
5
double
erand48
(
unsigned short
s
[
3
])
6
{
7
union
{
8
uint64_t
u
;
9
double
f
;
10
}
x
= {
0x3ff0000000000000
ULL
|
__rand48_step
(
s
,
__seed48
+
3
)<<
4
};
11
return
x
.
f
-
1.0
;
12
}
13
14
double
drand48
(
void
)
15
{
16
return
erand48
(
__seed48
);
17
}