github
13 of 238 branches covered (5.46%)
Branch coverage included in aggregate %.
0 of 472 new or added lines in 41 files covered. (0.0%)
19728 existing lines in 193 files now uncovered.91 of 28170 relevant lines covered (0.32%)
0.02 hits per line
UNCOV
1
|
/** Creates a deterministic pseudorandom number generator */
|
|
UNCOV
2
|
export function makeRandomNumberGenerator(): () => number {
|
× |
UNCOV
3
|
let s = 1;
|
× |
UNCOV
4
|
let c = 1;
|
× |
UNCOV
5
|
return () => {
|
× |
6 |
s = Math.sin(c * 17.23); |
× |
7 |
c = Math.cos(s * 27.92); |
× |
8 |
return fract(Math.abs(s * c) * 1432.71); |
× |
UNCOV
9
|
}; |
× |
UNCOV
10
|
} |
× |
UNCOV
11
|
|
× |
12 |
function fract(n: number): number { |
× |
13 |
return n - Math.floor(n);
|
× |
14 |
} |
× |
UNCOV
15
|
|
× |
UNCOV
16
|
/** Generates a deterministic pseudorandom number */
|
× |
UNCOV
17
|
export const random = makeRandomNumberGenerator(); |
× |