Skip to content

Chop

Replaces a real number very close to 0 with exact 0.

Wolfram LanguageChop
Chop(x)0 if is smaller than about , else x unchanged.

Domain: Arithmetic

Details
  • Replaces a value smaller in magnitude than about with exact 0 -- cleanup for the floating-point noise left over from a numeric computation.
  • Chops the real and imaginary parts of a complex number independently.
  • Only the value's own magnitude matters -- stays as is, since it isn't close to 0, even though it's close to the integer 1.
  • Takes a single argument; there's no way to override the threshold.

Examples

See also: Round