rec.prot {cwhmisc}R Documentation

Protected division

Description

1/x, but 1/0 -> 0

Usage

  rec.prot(x, eps = .Machine$double.eps)

Arguments

x array to invert.
eps limit: if abs(x) < eps then 1/x -> 0.

Author(s)

Christian W. Hoffmann <c-w.hoffmann@sunrise.ch>
http://www.wsl.ch/personal_homepages/hoffmann/index_EN

Examples

  rec.prot(c(0,.Machine$double.eps,1.0e-10,1,1.0e100))
  rec.prot(c(0,.Machine$double.eps,1.0e-10,1,1.0e100), 100*.Machine$double.eps)

[Package cwhmisc version 2.0.1 Index]