PolynomF (version 2.0-2)

zap: Remove minuscule coefficients

Description

A convenience function for setting polynomial coefficients likely to be entirely round-off error to zero. The decision is relegated to the function base::zapsmall, to which this is a front-end.

Usage

zap(x, digits = getOption("digits"))

# S3 method for default zap(x, digits = getOption("digits"))

# S3 method for polynom zap(x, digits = getOption("digits"))

# S3 method for polylist zap(x, digits = getOption("digits"))

# S3 method for list zap(x, digits = getOption("digits"))

Arguments

x

A polynomial or polylist object

digits

As for base::zapsmall

...

Passed on to base::zapsmall

Value

A polynomial or polylist object with minuscule coefficients set to zero.

Examples

Run this code
# NOT RUN {
(P <- poly_orth(-2:2, norm = FALSE))
zap(35*P)
# }

Run the code above in your browser using DataCamp Workspace