"), sep='')]
xmin <- umach[1]
xmax <- umach[2]
tx <- unique(c(outer(-1:1,c(.1,1e-3,1e-7))))# 7 values  (out of 9)
tx <- unique(sort(c(outer(umach,1+tx))))# 11 values (+ 1 Inf)
length(tx <- tx[is.finite(tx)]) # 11
(txp <- tx[tx >= 1])#-- Positive exponent -- 4 values
(txn <- tx[tx <	 1])#-- Negative exponent -- 7 values

x2 <- c(0.099999994, 0.2)
x2 # digits=7: show all seven "9"s
print(x2, digits=6) # 0.1 0.2 , not 0.10 0.20
v <- 6:8; names(v) <- v; sapply(v, format.info, x=x2)

(z <- sort(c(outer(range(txn), 8^c(0,2:3)))))
outer(z, 0:6, signif) # had NaN's till 1.1.1

olddig <- options(digits=14) # RH6.0 fails at 15
z <- 1.234567891234567e27
for(dig in 1:14) cat(formatC(dig,w=2),
                     format(z, digits=dig), signif(z, digits=dig), "\n")
options(olddig)
# The following are tests of printf inside formatC
##------ Use  Emacs screen width 134 ;	Courier 12 ----
# cat("dig|  formatC(txp, d=dig)\n")
# for(dig in 1:17)# about >= 18 is platform dependent [libc's printf()..].
#     cat(formatC(dig,w=2), formatC(txp,		      dig=dig, wid=-29),"\n")
# cat("signif() behavior\n~~~~~~~~\n",
#     "dig|  formatC(signif(txp, dig=dig), dig = dig\n")
# for(dig in 1:15)#
#     cat(formatC(dig,w=2), formatC(signif(txp, d=dig), dig=dig, wid=-26),"\n")

# if(opt.conformance >= 1) {
#     noquote(cbind(formatC(txp, dig = 22)))
# }

# cat("dig|  formatC(signif(txn, d = dig), dig=dig\n")
# for(dig in 1:15)#
#     cat(formatC(dig,w=2), formatC(signif(txn, d=dig), dig=dig, wid=-20),"\n")

# ##-- Testing  'print' / digits :
# for(dig in 1:13) { ## 12:13: libc-2.0.7 diff; 14:18 --- PLATFORM-dependent !!!
#     cat("dig=",formatC(dig,w=2),": "); print(signif(txp, d=dig),dig=dig+1)
# }

##-- Wrong alignment when printing character matrices with  quote = FALSE
m1 <- matrix(letters[1:24],6,4)
m1
noquote(m1)

##--- Complex matrices and named vectors :

x0 <- x <- c(1+1i, 1.2 + 10i)
names(x) <- c("a","b")
x
(xx <-	rbind(x,  2*x))
	rbind(x0, 2*x0)
x[4:6] <- c(Inf,Inf*c(-1,1i))
x  + pi
matrix(x + pi, 2)
matrix(x + 1i*pi, 3)
xx + pi
t(cbind(xx, xx+ 1i*c(1,pi)))

#--- format checks after incorrect changes in Nov 2000
zz <- data.frame("(row names)" = c("aaaaa", "b"), check.names = FALSE)
format(zz)
format(zz, justify = "left")
zz <- data.frame(a = I("abc"), b = I("def\"gh"))
format(zz)
# " (font-locking: closing the string above)

# test format.data.frame on former AsIs's.
set.seed(321)
dd <- data.frame(x = 1:5, y = rnorm(5), z = c(1, 2, NA, 4, 5))
model <- glm(y ~ x, data = dd, subset = 1:4, na.action = na.omit)
expand.model.frame(model, "z", na.expand = FALSE)
expand.model.frame(model, "z", na.expand = TRUE)

## print.table() changes affecting summary.data.frame
options(width=82)
summary(attenu) # ``one line''
lst <- levels(attenu$station)
levels(attenu$station)[lst == "117"] <- paste(rep(letters,3),collapse="")
summary(attenu) # {2 + one long + 2 } variables
## in 1.7.0, things were split to more lines

## format.default(*, nsmall > 0)  -- for real and complex

sf <- function(x, N=14) sapply(0:N, function(i) format(x,nsmall=i))
sf(2)
sf(3.141)
sf(-1.25, 20)

oDig <- options(digits= 3)
sf(pi)
sf(1.2e7)
sf(1.23e7)
s <- -0.01234
sf(s)

sf(pi + 2.2i)
sf(s + pi*1i)

options(oDig)

e1 <- tryCatch(options(max.print=Inf), error=function(e)e)
e2 <- tryCatch(options(max.print= 0),  error=function(e)e)
stopifnot(inherits(e1, "error"))


## Printing of "Date"s
options(width = 80)
op <- options(max.print = 500)
dd <- as.Date("2012-03-12") + -10000:100
writeLines(t1 <- tail(capture.output(dd)))
l6 <- length(capture.output(print(dd, max = 600)))
options(op)
t2 <- tail(capture.output(print(dd, max = 500)))
stopifnot(identical(t1, t2), l6 == 121)
## not quite consistent in R <= 2.14.x

