2
##- [2,]    0 0.0004113534 0.01295763 0.103661 0.3023447 0.3628137 0.1814068
##-	       [,8]	  [,9] [,10] [,11]
##- [1,] 0.99814891 1.00000000	   1	 1
##- [2,] 0.03455368 0.00185109	   0	 0

m11 <- c(-1,1)
Mm <- pi*outer(m11, 10^(-5:5))
Mm <- cbind(Mm, outer(m11, 10^-(5:1)))
Mm
do.p <- TRUE
do.p <- FALSE
for(di in 1:10) {
    options(digits=di)
    cat(if(do.p)"\n",formatC(di,w=2),":", format.info(Mm),"\n")
    if(do.p)print(Mm)
}
##-- R-0.49 (4/1997)	 R-0.50-a1 (7.7.97)
##-  1 : 13 5 0		 1 :  6 0 1
##-  2 :  8 1 1	=	 2 :  8 1 1
##-  3 :  9 2 1	=	 3 :  9 2 1
##-  4 : 10 3 1	=	 4 : 10 3 1
##-  5 : 11 4 1	=	 5 : 11 4 1
##-  6 : 12 5 1	=	 6 : 12 5 1
##-  7 : 13 6 1	=	 7 : 13 6 1
##-  8 : 14 7 1	=	 8 : 14 7 1
##-  9 : 15 8 1	=	 9 : 15 8 1
##- 10 : 16 9 1	=	10 : 16 9 1
nonFin <- list(c(Inf,-Inf), c(NaN,NA), NA_real_, Inf)
mm <- sapply(nonFin, format.info)
fm <- lapply(nonFin, format)
w <- c(4,3,2,3)
stopifnot(sapply(lapply(fm, nchar), max) == w,
	  mm == rbind(w, 0, 0))# m[2,] was 2147483647; m[3,] was 1
cnF <- c(lapply(nonFin, function(x) complex(re=x, im=x))[-3],
         complex(re=NaN, im=-Inf))
cmm <- sapply(cnF, format.info)
cfm <- lapply(cnF, format)
cw <- sapply(lapply(cfm, nchar), max)
stopifnot(cw == cmm[1,]+1 +cmm[4,]+1,
	  nchar(format(c(NA, 1 + 2i))) == 4)# wrongly was (5,4)


##-- Ok now, everywhere
for(d in 1:9) {cat(d,":"); print(v4, digits=d) }
DIG(7)
