diff --git a/src/math/math.ts b/src/math/math.ts index 4bef0a9d..d9a5546f 100644 --- a/src/math/math.ts +++ b/src/math/math.ts @@ -1132,9 +1132,8 @@ export function rand(...args: [] | [T] | [T, T]) { return defRNG.genAny(...args); } -// TODO: randi() to return 0 / 1? export function randi(...args: [] | [number] | [number, number]) { - return Math.floor(rand(...args)); + return Math.floor(rand(...(args.length > 0 ? args : [2]))); } export function chance(p: number): boolean {