Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/rimbu/typical/num.ts>Subtract

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

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>>>