MCPcopy
hub / github.com/sparkjsdev/spark / imodOutputType

Function imodOutputType

src/dyno/mathTypes.ts:535–551  ·  view source on GitHub ↗
(
  a: A,
  b: B,
)

Source from the content-addressed store, hash-verified

533}
534
535export function imodOutputType<A extends AllIntTypes, B extends AllIntTypes>(
536 a: A,
537 b: B,
538): IModOutput<A, B> {
539 // @ts-ignore
540 if (a === b) return a as IModOutput<A, B>;
541 if (a === "int") {
542 if (isIntType(b)) return b as IModOutput<A, B>;
543 } else if (b === "int") {
544 if (isIntType(a)) return a as IModOutput<A, B>;
545 } else if (a === "uint") {
546 if (isUintType(b)) return b as IModOutput<A, B>;
547 } else if (b === "uint") {
548 if (isUintType(a)) return a as IModOutput<A, B>;
549 }
550 throw new Error(`Invalid imod types: ${a}, ${b}`);
551}
552
553export function modOutputType<A extends FloatTypes, B extends FloatTypes>(
554 a: A,

Callers

nothing calls this directly

Calls 2

isIntTypeFunction · 0.90
isUintTypeFunction · 0.90

Tested by

no test coverage detected