MCPcopy Create free account
hub / github.com/PageLeay/celestial-runtime / divSignal

Method divSignal

lib.commonjs/utils/fixednumber.js:323–333  ·  view source on GitHub ↗

* Returns a new [[FixedNumber]] with the result of %%this%% divided * by %%other%%. A [[NumericFaultError]] is thrown if underflow * (precision loss) occurs.

(other)

Source from the content-addressed store, hash-verified

321 * (precision loss) occurs.
322 */
323 divSignal(other) {
324 (0, errors_js_1.assert)(other.#val !== BN_0, "division by zero", "NUMERIC_FAULT", {
325 operation: "div", fault: "divide-by-zero", value: this
326 });
327 this.#checkFormat(other);
328 const value = (this.#val * this.#tens);
329 (0, errors_js_1.assert)((value % other.#val) === BN_0, "precision lost during signalling div", "NUMERIC_FAULT", {
330 operation: "divSignal", fault: "underflow", value: this
331 });
332 return this.#checkValue(value / other.#val, "divSignal");
333 }
334 /**
335 * Returns a comparison result between %%this%% and %%other%%.
336 *

Callers

nothing calls this directly

Calls 2

#checkFormatMethod · 0.95
#checkValueMethod · 0.95

Tested by

no test coverage detected