Learn R Programming

SignalY (version 1.1.1)

safe_divide: Safe Division with Zero Handling

Description

Performs division with protection against division by zero, returning a specified value (default NA) when the denominator is zero or very small.

Usage

safe_divide(
  numerator,
  denominator,
  zero_value = NA_real_,
  tol = .Machine$double.eps
)

Value

Numeric vector of quotients.

Arguments

numerator

Numeric vector of numerators.

denominator

Numeric vector of denominators.

zero_value

Value to return when denominator is effectively zero. Default is NA.

tol

Tolerance for considering denominator as zero. Default is .Machine$double.eps.