isZero

isZero(x)

Try it yourself:


isZero(): test for zero

isZero(x) returns whether x is zero. It is particularly useful before division, normalization, matrix inversion, and logic that treats the origin as a special case.

Prevent invalid operations

Test a denominator before division, and test a determinant before inv(). For sign classification, combine it with isPositive() and isNegative(). abs() helps formulate tolerance checks.

Exact versus approximate zero

Computed decimal values can be close to zero without equaling it exactly. In measurement and floating-point models, compare the magnitude to a chosen tolerance instead of relying only on exact equality.

Try Is Zero 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