Learn R Programming

gmp (version 0.5-4)

Extremes: Extrema (Maxima and Minima)

Description

We provide S3 methods for min and max for big rationals (bigq) and big integers (biqz); consequently, range() works as well.

Usage

## S3 method for class 'bigz':
max(..., na.rm=FALSE)
## S3 method for class 'bigq':
max(..., na.rm=FALSE)
## S3 method for class 'bigz':
min(..., na.rm=FALSE)
## S3 method for class 'bigq':
min(..., na.rm=FALSE)

Arguments

...
numeric arguments
na.rm
a logical indicating whether missing values should be removed.

Value

  • return an element of class bigz or bigq.

See Also

max

Examples

Run this code
x <- as.bigz(1:10)
 max(x)
 min(x)
 range(x) # works correctly via default method

 Q <- as.bigq(1:10, 3)
 max(Q)
 min(Q)

stopifnot(range(x) == c(1,10), 3*range(Q) == c(1,10))

Run the code above in your browser using DataLab