WLJS LogoWLJS Notebook

Chop

Chop[expr] replaces approximate real numbers in expr that are close to zero by the exact integer 0.

Chop[expr, delta] replaces numbers smaller in absolute magnitude than delta by 0.

Examples

Remove small numerical noise:

Chop[0.00000001]
(* 0 *)

Chop complex numbers:

Chop[1.0 + 1.*^-12 I]
(* 1. *)

Custom tolerance:

Chop[0.001, 0.01]
(* 0 *)

Please visit the official Wolfram Language Reference for more details.

On this page