divide

divide

Divides two numbers returns fallback if result is not a finite number

Import

import { divide } from '@fullstacksjs/toolbox';

Signature

function divide(dividend: number, divisor: number, fallback: number = NaN): number {}

Examples

divide(4, 2)     // 2
divide(4, 0, 42) // 42
divide(4, 0)     // NaN