rational-functions: Functions of Rational Numbers

rational-functionsR Documentation

Functions of Rational Numbers

Description

Functions of Rational Numbers

Usage

## S4 method for signature 'rationalS4'
Math(x)

## S3 method for class 'rationalS3'
Math(x, ...)

## S3 method for class 'rationalR6'
Math(x, ...)

## S3 method for class ''rational::rationalS7''
Math(x, ...)

## S4 method for signature 'rationalS4'
Math2(x)

## S4 method for signature 'rationalS4'
abs(x)

## S3 method for class 'rationalS3'
abs(x)

## S3 method for class 'rationalR6'
abs(x)

## S3 method for class ''rational::rationalS7''
abs(x)

## S4 method for signature 'rationalS4'
log(x, base = exp(1))

## S3 method for class 'rationalS3'
log(x, base = exp(1))

## S3 method for class 'rationalR6'
log(x, base = exp(1))

## S3 method for class ''rational::rationalS7''
log(x, base = exp(1))

## S4 method for signature 'rationalS4'
log10(x)

## S3 method for class 'rationalS3'
log10(x)

## S3 method for class 'rationalR6'
log10(x)

## S3 method for class ''rational::rationalS7''
log10(x)

## S4 method for signature 'rationalS4'
logb(x, base = exp(1))

logb.rationalS3(x, base = exp(1))

logb.rationalR6(x, base = exp(1))

`logb.rational::rationalS7`(x, base = exp(1))

## S4 method for signature 'rationalS4'
log2(x)

## S3 method for class 'rationalS3'
log2(x)

## S3 method for class 'rationalR6'
log2(x)

## S3 method for class ''rational::rationalS7''
log2(x)

## S4 method for signature 'rationalS4'
gamma(x)

## S3 method for class 'rationalS3'
gamma(x)

## S3 method for class 'rationalR6'
gamma(x)

## S3 method for class ''rational::rationalS7''
gamma(x)

## S4 method for signature 'rationalS4'
max(x, ..., na.rm = FALSE)

## S3 method for class 'rationalS3'
max(..., na.rm = FALSE)

## S3 method for class 'rationalR6'
max(..., na.rm = FALSE)

## S3 method for class ''rational::rationalS7''
max(..., na.rm = FALSE)

## S4 method for signature 'rationalS4'
min(x, ..., na.rm = FALSE)

## S3 method for class 'rationalS3'
min(..., na.rm = FALSE)

## S3 method for class 'rationalR6'
min(..., na.rm = FALSE)

## S3 method for class ''rational::rationalS7''
min(..., na.rm = FALSE)

## S4 method for signature 'rationalS4'
range(x, ..., na.rm = FALSE)

## S3 method for class 'rationalS3'
range(..., na.rm = FALSE)

## S3 method for class 'rationalR6'
range(..., na.rm = FALSE)

## S3 method for class ''rational::rationalS7''
range(..., na.rm = FALSE)

## S4 method for signature 'rationalS4'
prod(x, ..., na.rm = FALSE)

## S3 method for class 'rationalS3'
prod(..., na.rm = FALSE)

## S3 method for class 'rationalR6'
prod(..., na.rm = FALSE)

## S3 method for class ''rational::rationalS7''
prod(..., na.rm = FALSE)

## S4 method for signature 'rationalS4'
sum(x, ..., na.rm = FALSE)

## S3 method for class 'rationalS3'
sum(..., na.rm = FALSE)

## S3 method for class 'rationalR6'
sum(..., na.rm = FALSE)

## S3 method for class ''rational::rationalS7''
sum(..., na.rm = FALSE)

Arguments

x

rational numbers

...

rational numbers

base

the logarithm base in the logb function

na.rm

will NAs be removed from a collection before the computation is performed

Examples

floor(rational(5L, 2L, "S4"))
sign(rational(-1L, 2L, "S4"))
exp(rational(1L, 3L, "S3"))
exp(rational(1L, 3L, "R6"))
exp(rational(1L, 3L, "S7"))
round(rational(5L, 2L, "S4"), 0)
x <- abs(rational(-2L, 3L, "S4"))
stopifnot("rationalS4" %in% class(x))
x <- abs(rational(-2L, 3L, "S3"))
stopifnot("rationalS3" %in% class(x))
x <- abs(rational(-2L, 3L, "R6"))
stopifnot("rationalR6" %in% class(x))
x <- abs(rational(-2L, 3L, "S7"))
stopifnot("rational::rationalS7" %in% class(x))
log(rational(2L, 5L, "S4"))
log(rational(2L, 5L, "S3"))
log(rational(2L, 5L, "R6"))
log(rational(2L, 5L, "S7"))
log10(rational(2L, 5L, "S4"))
log10(rational(2L, 5L, "S3"))
log10(rational(2L, 5L, "R6"))
log10(rational(2L, 5L, "S7"))
logb(rational(2L, 5L, "S4"), base = 5)
logb(rational(2L, 5L, "S3"), base = 5)
logb(rational(2L, 5L, "R6"), base = 5)
logb(rational(2L, 5L, "S7"), base = 5)
log2(rational(2L, 5L, "S4"))
log2(rational(2L, 5L, "S3"))
log2(rational(2L, 5L, "R6"))
log2(rational(2L, 5L, "S7"))
gamma(rational(2L, 5L, "S4"))
gamma(rational(2L, 5L, "S3"))
gamma(rational(2L, 5L, "R6"))
gamma(rational(2L, 5L, "S7"))
max(rational(c(2L, 3L), c(5L, 1L), "S4"))
max(rational(c(2L, 3L), c(5L, 1L), "S3"))
max(rational(c(2L, 3L), c(5L, 1L), "R6"))
max(rational(c(2L, 3L), c(5L, 1L), "S7"))
min(rational(c(2L, 3L), c(5L, 1L), "S4"))
min(rational(c(2L, 3L), c(5L, 1L), "S3"))
min(rational(c(2L, 3L), c(5L, 1L), "R6"))
min(rational(c(2L, 3L), c(5L, 1L), "S7"))
range(rational(c(2L, 3L), c(5L, 1L), "S4"))
range(rational(c(2L, 3L), c(5L, 1L), "S3"))
range(rational(c(2L, 3L), c(5L, 1L), "R6"))
range(rational(c(2L, 3L), c(5L, 1L), "S7"))
prod(rational(c(2L, 3L), c(5L, 1L), "S4"))
prod(rational(c(2L, 3L), c(5L, 1L), "S3"))
prod(rational(c(2L, 3L), c(5L, 1L), "R6"))
prod(rational(c(2L, 3L), c(5L, 1L), "S7"))
sum(rational(c(2L, 3L), c(5L, 1L), "S4"))
sum(rational(c(2L, 3L), c(5L, 1L), "S3"))
sum(rational(c(2L, 3L), c(5L, 1L), "R6"))
sum(rational(c(2L, 3L), c(5L, 1L), "S7"))

bertcarnell/rational documentation built on Aug. 1, 2024, 8:14 p.m.