From a9315017292c064d6d5e2d6fc81ad691155efa17 Mon Sep 17 00:00:00 2001 From: Travis Fischer Date: Wed, 4 Sep 2024 13:59:49 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=99=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/distributions/normal.test.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/distributions/normal.test.ts b/src/distributions/normal.test.ts index ca7f868..263f9a2 100644 --- a/src/distributions/normal.test.ts +++ b/src/distributions/normal.test.ts @@ -29,10 +29,20 @@ const meanN = (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)