Skip to content

divTrunc

divTrunc(dividend, divisor): number

Defined in: packages/core/src/number/integer/div-trunc.ts:11

Truncating division — rounds toward zero, as Math.trunc(a / b) does.

Computed from the remainder rather than by truncating a float quotient, so the result is the exact integer whenever both operands are safe integers.

divTrunc(-7, 2) === -3.

number

number

number

When divisor is zero.