InternalThe numeric type of the dividend and of the quotient
The dividend
The divisor
The quotient of x by y, as an IEEE 754 double for a number dividend, or rounded to the nearest
integer, halves away from zero, for a bigint dividend
RangeError If x is a bigint and y is not a finite integer or is 0
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.