( a: A, b: B, )
| 533 | } |
| 534 | |
| 535 | export 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 | |
| 553 | export function modOutputType<A extends FloatTypes, B extends FloatTypes>( |
| 554 | a: A, |
nothing calls this directly
no test coverage detected