Skip to the content

Tane種

Reproduce numbers from a seed, shuffle or pick items, share a daily puzzle and resume a saved stream.

Tane means seed in Japanese. About the name

Contents

Reference · Streams, draws and seeds

normalfunction

A number from a normal distribution (Box–Muller): two draws.

Import it

import { normal } from "@johnmorrisdotca/tane";

Definition

function normal(random: Random, mean?: number, spread?: number): number

Parameters

NameTypeDescription
randomRandom

A random source returning values in [0, 1).

mean (optional)number

The normal distribution’s mean.

spread (optional)number

The normal distribution’s standard deviation.

Returns

number

A number from a normal distribution (Box–Muller): two draws.

Examples

import { mulberry32, normal } from "@johnmorrisdotca/tane";

const random = mulberry32(42);
console.log(normal(random, 10, 2));
8.087675541231702

What it prints (run when this page was built)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/tane 1.3.0.