R Under development (unstable) (2023-11-07 r85491 ucrt) -- "Unsuffered Consequences" Copyright (C) 2023 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. > ### > ### f a c t o r s . R +++ Test suite +++ > ### > > > test.factors <- function(input, expected) { + output <- do.call(getFromNamespace("factors", "pracma"), input) + identical(output, expected) + } > > factors.expected.n2 <- 2 > factors.expected.n3 <- 3 > # factors.expected.prm <- 999983 > # factors.expected.pr2 <- c(9999889, 9999901) > # factors.expected.prp <- c(65003, 65003) > # factors.expected.nn <- c(2, 2, 2, 2, 2, 3, 3, 3, 3, 5, 5, 5, 7, 7, 11) > # factors.expected.nm <- c(99989, 99991, 100003) > # factors.expected.n32 <- c(3, 5, 17, 257, 65537) > > test.factors(list(n=2), factors.expected.n2) [1] TRUE > test.factors(list(n=3), factors.expected.n3) [1] TRUE > # test.factors(list(n=999983), factors.expected.prm) > # test.factors(list(n=9999889*9999901), factors.expected.pr2) > # test.factors(list(n=4225390009), factors.expected.prp) > # test.factors(list(n=2^5 * 3^4 * 5^3 * 7^2 * 11), factors.expected.nn) > # test.factors(list(n=99989*99991*100003), factors.expected.nm) > # test.factors(list(n=2^32-1), factors.expected.n32) > > proc.time() user system elapsed 0.17 0.01 0.18