zuyaml_bigint: Integers too large for R's numeric types

View source: R/bigint.R

zuyaml_bigintR Documentation

Integers too large for R's numeric types

Description

A character vector holding the decimal representation of integers that R cannot store exactly: beyond 2^53 a double silently loses precision, and R has no native 64-bit integer scalar.

Usage

zuyaml_bigint(x)

Arguments

x

A character vector of decimal integers, or an object to coerce.

Details

yaml_parse() returns one of these when it meets such a value and big_integers = "bigint" (the default). It carries the decimal normalisation of the value, not the source text, so 0x1FFFFFFFFFFFFFFF and its decimal spelling compare equal.

This is a marker for values whose precision must be preserved, not a big-integer arithmetic type: there is no arithmetic. Use as.numeric() to accept the precision loss deliberately, or a package such as bit64 for real 64-bit arithmetic.

Value

zuyaml_bigint() returns a character vector of class "zuyaml_bigint".

Examples

yaml_parse("9223372036854775807")
as.numeric(yaml_parse("9223372036854775807")) # lossy, on purpose

zuyaml documentation built on Oct. 7, 2026, 5:08 p.m.