R Under development (unstable) (2023-12-09 r85665 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. > suppressPackageStartupMessages(library(float)) > suppressPackageStartupMessages(library(utils)) > > m = 10L > n = 3L > > x = matrix(1:(m*n), m, n) > xs = fl(x) > > stopifnot(identical(nrow(x), m)) > stopifnot(identical(ncol(x), n)) > stopifnot(identical(dim(x), c(m, n))) > > p = paste(capture.output(print(xs)), collapse="\n") > truth = "# A float32 matrix: 10x3 + [,1] [,2] [,3] + [1,] 1 11 21 + [2,] 2 12 22 + [3,] 3 13 23 + [4,] 4 14 24 + [5,] 5 15 25 + [6,] 6 16 26 + [7,] 7 17 27 + [8,] 8 18 28 + [9,] 9 19 29 + [10,] 10 20 30" > > stopifnot(identical(p, truth)) > > proc.time() user system elapsed 0.29 0.04 0.34