zap: Remove minuscule coefficients

View source: R/Orthogonal_polynomials.R

zapR Documentation

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

## Default S3 method:
zap(x, digits = getOption("digits"))

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

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

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

Arguments

x

A polynomial or polylist object

digits

As for base::zapsmall

Value

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

Examples

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

PolynomF documentation built on May 2, 2022, 9:07 a.m.