####-- Examples / Experiment, using  scientific(),
####   the R function that does the same as 'scientific' in
####   <Rsource>/src/main/format.c

source("scientific.R")# for function definitions
##      ~~~~~~~~~~~~

scientific(pi)
scientific(pi,14)
scientific(pi,17)# 0 0 16

tens <- names.num(10 ^ (-2:6))
do.sci(tens)
do.sci(3.1 * tens)
do.sci(pi  * tens)
do.sci(pi  * tens, dig = 12)

## v1 from /u/maechler/R/print-tests.R
if(!exists("v1")) v1 <- 10^c(-4:0,2,4)
do.sci(v1)

## Ben's example (*, digits=2)
x2 <- c(outer(c(-1,1), c(7.92, 7.921)))
x2 <- c(x2, 10^c(-10,-3, -1:1, 3,10))
do.sci(x2, 4, digits = 2)
