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

Function bigintSign

src/big-decimal/utils.ts:191–195  ·  view source on GitHub ↗
(n: bigint)

Source from the content-addressed store, hash-verified

189
190/** Sign of a bigint: -1n, 0n, or 1n. */
191export function bigintSign(n: bigint): bigint {
192 if (n > 0n) return 1n;
193 if (n < 0n) return -1n;
194 return 0n;
195}
196
197/** Count the number of decimal digits in a bigint (absolute value). */
198export function bigintDigits(n: bigint): number {

Callers 1

utils.test.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected