Learn R Programming

PolynomF (version 2.0-8)

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"))

Value

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

Arguments

x

A polynomial or polylist object

digits

As for base::zapsmall

Examples

Run this code
(P <- poly_orth(-2:2, norm = FALSE))
zap(35*P)

Run the code above in your browser using DataLab