Skip to main content
Module

x/rimbu/typical/mod.ts>Num.Subtract

Rimbu is a TypeScript library focused on immutable, performant, and type-safe collections and other tools.
Go to Latest
type alias Num.Subtract
import { type Num } from "https://deno.land/x/rimbu@0.12.3/typical/mod.ts";
const { Subtract } = Num;

Returns the result of subtracting N2 from N1.

Examples

Example 1

Subtract<25, 13> => 12
Subtract<1721, 335> => 1386
Subtract<5, 8> => never

Type Parameters

N1 extends number
N2 extends number
definition: N1 extends never ? never : N2 extends never ? never : StrNum.ToNumber<StrNum.Subtract<StrNum.FromNumber<N1>, StrNum.FromNumber<N2>>>