divide

x / y

divide(x, y)

Try it yourself:

See also:

divide(): Quotients and Mathematical Division

divide() divides one value by another. For numbers, divide(12, 3) returns 4. It is useful when expressing rates, conversions, averages, proportions, and normalization in a readable function form.

Never ignore the denominator

Division by zero is undefined in ordinary real arithmetic. Test values with equal() or protect a model using and() before division. Very small denominators are also important because they can create huge, unstable values.

For matrices, divide has rules that differ from ordinary matrix multiplication; use dotDivide() when you explicitly need element-wise quotients. Pair division with multiply() to check a result, and apply round() only when presenting a value.

Units and precision

Division naturally changes units: kilometres divided by hours produces a speed. Keep units compatible and retain precision through intermediate calculations. For a collection’s average, combine sum() with its count deliberately.

Try Divide in Calcul.io

Start with one of the editable examples above, then replace its arguments with your own values. Keeping the function on a separate calculator line makes the input and result easy to compare. For a longer workflow, assign the result to a variable or reference that line in the next expression.

Check the shown signature before adding optional arguments, and use the related-function links to compare operations with similar purposes.

All functions