MCPcopy Create free account
hub / github.com/cortex-js/compute-engine / pow10

Function pow10

src/big-decimal/utils.ts:34–44  ·  view source on GitHub ↗
(n: number)

Source from the content-addressed store, hash-verified

32
33/** Return 10^n as a bigint, memoized for n <= POW10_CACHE_MAX. */
34export function pow10(n: number): bigint {
35 if (n <= POW10_CACHE_MAX) {
36 let v = _pow10Cache.get(n);
37 if (v === undefined) {
38 v = 10n ** BigInt(n);
39 _pow10Cache.set(n, v);
40 }
41 return v;
42 }
43 return 10n ** BigInt(n);
44}
45
46/** Bit length of |n| (the number of bits in its binary representation). */
47export function bitLength(n: bigint): number {

Callers 15

toFixedPointFunction · 0.90
fromFixedPointFunction · 0.90
cmpMethod · 0.90
eqMethod · 0.90
addMethod · 0.90
subMethod · 0.90
mulToPrecisionMethod · 0.90
truncMethod · 0.90
divMethod · 0.90
divTowardMethod · 0.90
sqrtTowardMethod · 0.90
modMethod · 0.90

Calls 2

getMethod · 0.65
setMethod · 0.65

Tested by

no test coverage detected