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

Function fpmul

src/big-decimal/utils.ts:65–67  ·  view source on GitHub ↗
(a: bigint, b: bigint, bits: number)

Source from the content-addressed store, hash-verified

63
64/** Fixed-point multiply on the base-2 grid: (a * b) >> bits */
65export function fpmul(a: bigint, b: bigint, bits: number): bigint {
66 return (a * b) >> BigInt(bits);
67}
68
69/** Fixed-point divide on the base-2 grid: (a << bits) / b */
70export function fpdiv(a: bigint, b: bigint, bits: number): bigint {

Callers 2

utils.test.tsFile · 0.90
transcendentals.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected