UNPKG
@juici/math
Version:
latest (0.1.0)
0.1.0
A mathematics utility library
Juici/math.js
@juici/math
/
src
/
math.ts
10 lines
(8 loc)
•
244 B
text/typescript
View Raw
1
2
3
4
5
6
7
8
9
10
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
; }