R Under development (unstable) (2025-12-14 r89168 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) > > > X <- arb(pi) > stopifnot(identical(Mid(X), arf(pi))) > X2 <- X; Mid(X2) <- 2 * pi # gave error in version 0.5.0 > ## Error in q@dim : > ## no applicable method for `@` applied to an object of class "function" > stopifnot(X2 == 2 * pi) > > > Z <- acb(pi) > Imag(Z) <- 1 # gave error in version 0.5.0 > ## Error in q@dim : > ## no applicable method for `@` applied to an object of class "function" > stopifnot(Z == pi + 1i) > > > (mZ <- Mid(Z)) # newly works class "acf", length 1, address 000001D9C65F8DD0 [1] 3.141593e+0+1.000000e+0i > stopifnot(is(mZ, "acf"), mZ == pi + 1i) > > > ## Dispatch ambiguity > nm <- norm(fmpz(matrix(0L, 0L, 0L))) # gave error in version 0.1.0 > ## Note: method with signature 'ANY#missing' chosen for function 'norm', > ## target signature 'fmpz#missing'. > ## "flint#ANY" would also be valid > ## Error in norm(x, type = "O", ...) : invalid 'x': type "S4" > stopifnot(identical(nm, fmpz(0L))) > > > ## Undefined behaviour (divide-by-zero in integer division) in > ## colSums(), rowSums(<0-by-n>), etc.; detected under x86_64 > cs <- colSums(fmpq.array(0L, c(2L, 0L))) > rs <- rowSums(fmpq.array(0L, c(0L, 2L))) > stopifnot(identical(cs, fmpq()), identical(rs, fmpq())) > > > ## Loop over 'cbind', 'rbind' *call* did not advance when filling > ## dimension names > x <- y <- ulong(0L) > cn <- colnames(cbind(x, y)) # gave c("x", "x") in version 0.1.0 > rn <- rownames(rbind(x, z = y)) # ditto > stopifnot(identical(cn, c("x", "y")), + identical(rn, c("x", "z"))) > > > ## Late assignment in array-handling branch of 'as.data.frame' > J <- diag(ulong(1L), 6L) > L <- as.data.frame(J) # gave error in version 0.1.0 > ## Error in h(simpleError(msg, call)) : > ## error in evaluating the argument 'i' in selecting a method for function '[': object 'r' not found > L. <- as.data.frame(diag(1L, 6L)) > L.[] <- lapply(L., ulong) > stopifnot(all.equal(L, L.)) # 'all.equal' recurses with dispatch > > > ## 'Summary' methods for 'ulong' and 'slong' kept attributes > validObject(u <- sum(ulong(1:2, names = c("a", "b")))) [1] TRUE > validObject(s <- range(slong.array(1:2, dim = c(2L, 2L)))) [1] TRUE > stopifnot(identical(u, ulong(3L)), identical(s, slong(1:2))) > > > ## all.equal(check.class = FALSE) failed to detect numerical differences > stopifnot(is.character(all.equal(0, arf(1), check.class = FALSE))) > > > ## tcrossprod(, ) determined inner dimension incorrectly > stopifnot(identical(fmpz(tcrossprod(1:6, 1:8)), + ## below gave "non-conformable arguments": + tcrossprod(fmpz(1:6), fmpz(1:8))), + identical(fmpq(tcrossprod(1:6, 1:6)), + ## below could trigger a segfault: + tcrossprod(fmpq(1:6), fmpq(1:6)))) > > > ## names(c(...)) was constructed incorrectly > x <- 1L > y <- 1L:2L > z <- `names<-`(1L:3L, c("z", "zz", "zzz")) > stopifnot(identical(c(slong(), a = x, b = y, c = z), + slong(c(a = x, b = y, c = z)))) > > > ## Arg(x) gave sign(x) * pi for 'x' of class 'mag', 'arf', 'arb' > stopifnot(all.equal(Arg(mag(c( 0, 1))), mag(c( 0, 0))), + all.equal(Arg(arf(c(-1, 0, 1))), arf(c(pi, 0, 0))), + all.equal(Arg(arb(c(-1, 0, 1))), arb(c(pi, 0, 0)))) > > > ## 0/0, Inf/Inf returned Inf for operands of class 'mag' > stopifnot(tryCatch(mag( 0)/mag( 0), error = function (e) TRUE), + tryCatch(mag(Inf)/mag(Inf), error = function (e) TRUE)) > > > ## diag(x) <- value assigned to entries in the first row > x <- slong.array(0L, c(4L, 6L)) > diag(x) <- slong(1L) > stopifnot(identical(print(x), slong(diag(1L, 4L, 6L)))) class "slong", dim (4,6), address 000001D9CA6C7F90 [,1] [,2] [,3] [,4] [,5] [,6] [1,] 1 0 0 0 0 0 [2,] 0 1 0 0 0 0 [3,] 0 0 1 0 0 0 [4,] 0 0 0 1 0 0 > > proc.time() user system elapsed 0.90 0.07 0.96