The quotient keeps the numeric type of the dividend. A number dividend divides as an IEEE 754 double, yielding an
infinity on a zero divisor rather than reporting an error. A bigint dividend yields a bigint quotient: as no
fractional bigint can carry the remainder, the exact quotient is rounded to the nearest integer, halves away from
zero, whatever the sign of the operands.
Dividing a bigint requires a finite integral divisor, as the divisor is converted to a bigint first, and a
non-zero one, as no bigint stands for an infinity.
Type Parameters
Vextendsnumber|bigint
The numeric type of the dividend and of the quotient
Divides a numeric value by a divisor.
The quotient keeps the numeric type of the dividend. A
numberdividend divides as an IEEE 754 double, yielding an infinity on a zero divisor rather than reporting an error. Abigintdividend yields abigintquotient: as no fractionalbigintcan carry the remainder, the exact quotient is rounded to the nearest integer, halves away from zero, whatever the sign of the operands.Dividing a
bigintrequires a finite integral divisor, as the divisor is converted to abigintfirst, and a non-zero one, as nobigintstands for an infinity.