# bignum-math: Mathematical operations In bignum: Arbitrary-Precision Integer and Floating-Point Mathematics

 bignum-math R Documentation

## Mathematical operations

### Description

biginteger and bigfloat vectors support many of the standard mathematical operations. The base R documentation can be found by searching for the individual functions (e.g. `mean()`).

### Value

The returned value depends on the individual function. We recommend reading the base R documentation for a specific function to understand the expected result.

Other bignum operations: `bignum-arith`, `bignum-compare`, `bignum-special`

### Examples

``````# summary
x <- bigfloat(1:5)
sum(x)
prod(x)
max(x)
min(x)
range(x)
mean(x)

# cumulative
x <- bigfloat(1:5)
cumsum(x)
cumprod(x)
cummax(x)
cummin(x)

# rounding
x <- bigfloat(1.5)
floor(x)
ceiling(x)
trunc(x)

# miscellaneous
x <- bigfloat(2)
abs(x)
sign(x)
sqrt(x)

# logarithms and exponentials
x <- bigfloat(2)
log(x)
log10(x)
log2(x)
log1p(x)
exp(x)
expm1(x)

# trigonometric
x <- bigfloat(0.25)
cos(x)
sin(x)
tan(x)
acos(x)
asin(x)
atan(x)
cospi(x)
sinpi(x)
tanpi(x)

# hyperbolic
x <- bigfloat(0.25)
cosh(x)
sinh(x)
tanh(x)
acosh(bigfloat(2))
asinh(x)
atanh(x)

# special functions
x <- bigfloat(2.5)
gamma(x)
lgamma(x)
digamma(x)
trigamma(x)
factorial(x)
lfactorial(x)
``````

bignum documentation built on May 4, 2023, 9:10 a.m.