R Under development (unstable) (2025-02-18 r87748 ucrt) -- "Unsuffered Consequences" Copyright (C) 2025 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > library(flint) > > p. <- c(0L, as.integer(cumprod(rep(c(1, 2), c(1L, 30L))))) > x. <- c(-rev(p.), p.) > > stopifnot(identical(format(.ulong(x = p.)), format(p.) ), + identical(format(.slong(x = x.)), format(x.) ), + identical(format( .fmpz(x = x.)), format(x.) ), + identical(format( .fmpq(x = x.)), paste0(format(x.), "/1"))) > > stopifnot(identical(format(.fmpq(num = c(-1L, -11L), den = c(11L, 1L))), + c(" -1/11", "-11/ 1")), + identical(format(.fmpq(x = c(-0x1p-12, 0x1p-6))), + c("-1/4096", " 1/ 64"))) > > f10 <- function (b) format(.slong(x = b), base = abs(b)) > s <- c(0:9, LETTERS, letters); ms <- c(" 0", paste0("-", s[-1L])) > stopifnot(all(vapply( 2:62 , f10, "") == "10"), + all(vapply(-(2:62), f10, "") == "-10"), + identical(format(.slong(x = 0:61 ), base = 62L), s), + identical(format(.slong(x = -(0:61)), base = 62L), ms)) > > ## TODO: test floating-point types after deciding about trailing zeros > > proc.time() user system elapsed 0.64 0.09 0.73