Chop
Replaces a real number very close to 0 with exact 0.
✓ checked against that system · ! checked, with disagreements (hover a chip)Wolfram Language
Chop!Chop(x)0 if is smaller than about , else x unchanged.Chop(x, tolerance)0 if is smaller than tolerance, else x unchanged.Typed signatures
| Type | Package | Applies |
|---|---|---|
(T) -> T where T: number | compute-engine | always |
(any, number?) -> any | combinatoricsreplaces compute-engine | always |
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.
- A second argument overrides the default threshold.
Examples
3 more kept as data, checked against the oraclesBasic #
Scope #
Possible issues #
Only the value's own magnitude matters -- this stays as is since it isn't close to 0, even though it's close to the integer 1
live ↗InOut
About
| Examples | 18 |
|---|---|
| Checked against | Wolfram Language 17 agree1 differ |
| Crosswalk | Wolfram Language |
See also: Round