int関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
An integer from min to max, both included: one draw.
インポート
import { int } from "@johnmorrisdotca/tane";
定義
function int(random: Random, min: number, max: number): number
引数
| 名前 | 型 | 説明 |
|---|---|---|
random | Random | A random source returning values in [0, 1). |
min | number | The included lower bound. |
max | number | The upper bound; included for int and excluded for float. |
戻り値
number
An integer from min to max, both included: one draw.
例
import { int, mulberry32 } from "@johnmorrisdotca/tane";
const random = mulberry32(42);
console.log(int(random, 1, 6));4出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。