UNPKG

@juici/math

Version:

A mathematics utility library

10 lines (8 loc) 244 B
export function divRem(numer: bigint, denom: bigint): [bigint, bigint] { const q = numer / denom; const r = numer % denom; return [q, r]; } export function cmp(x: bigint, y: bigint): -1 | 0 | 1 { return x === y ? 0 : x < y ? -1 : 1; }