biginteger {bignum}R Documentation

Arbitrary-Precision Integer Vectors

Description

biginteger() and as_biginteger() construct a vector designed to store any integer.

is_biginteger() checks if an object is of class bignum_biginteger.

Usage

biginteger(x = character())

as_biginteger(x)

is_biginteger(x)

Arguments

x

Object to be coerced or tested.

Value

An S3 vector of class bignum_biginteger.

See Also

NA_biginteger_ to represent missing values.

format() for pretty printing.

vignette("operations") for supported operations.

Examples

# default options limit displayed precision
biginteger(2)^50L

# display full precision
format(biginteger(2)^50L, notation = "dec")

# lossy casts raise a warning
biginteger(c(2, 2.5, 3))

# suppress warnings if they are expected
suppressWarnings(biginteger(c(2, 2.5, 3)))

# unsigned integers can be specified as hexadecimal
biginteger("0xffffffff")

[Package bignum version 0.3.2 Index]