UNPKG
lean4-code-actions
Version:
latest (1.1.32)
1.1.32
Refactorings and snippets for Lean 4
lean4-code-actions
/
libs
/
utils
/
bigint
/
fromBigIntToNumber.ts
7 lines
(5 loc)
•
251 B
text/typescript
View Raw
1
2
3
4
5
6
7
import
{
BigIntAllAssertions
}
from
'./BigIntAllAssertions'
export
const
fromBigIntToNumber
= (
value
:
bigint
) => {
BigIntAllAssertions
.
lte
(value,
BigInt
(
Number
.
MAX_SAFE_INTEGER
),
'value'
,
'BigInt(Number.MAX_SAFE_INTEGER)'
)
return
Number
(value) }