Skip to content

Commit

Permalink
🙏
Browse files Browse the repository at this point in the history
  • Loading branch information
transitive-bullshit committed Sep 4, 2024
1 parent 704bac0 commit a931501
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/distributions/normal.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,20 @@ const meanN = <T extends SeedOrRNG>(t: T) => {
}

test('random.normal(120) has mean 120', () => {
const mean = meanN(0)
assert.closeTo(mean, 120, 0.5)
})

test('random.normal(120) with seedrandom has mean 120', () => {
const mean = meanN(seedrandom('MzUyYjZjZmM4YWI5NzEwNDliZGRmOTE3'))
assert.closeTo(mean, 120, 0.5)
})

test('random.normal(120) with seed has mean 120', () => {
const mean = meanN('YzNlNmVhOTg0MjZkMTNhNzE2NDc3Mjkw')
assert.closeTo(mean, 120, 0.5)
})

test('random.normal(120) with XOR128RNG has mean 120', () => {
const mean = meanN(new XOR128RNG(100))
assert.closeTo(mean, 120, 0.5)
Expand Down

0 comments on commit a931501

Please sign in to comment.