I would like to know if and how the powers of 10 are related to the printing of scientific notation in the console. I've searched R docs and haven't found anything relevant, or that I really understand.
First off, my scipen
and digits
settings are
unlist(options("scipen", "digits"))
# scipen digits
# 0 7
Now, powers of 10 are printed normally up to the 4th power, and then printing switches to scientific notation at the 5th power.
10^(1:4)
# [1] 10 100 1000 10000
10^(1:5)
# [1] 1e+01 1e+02 1e+03 1e+04 1e+05
Interestingly, this does not happen for some other numbers larger than 10.
11^(1:5)
# [1] 11 121 1331 14641 161051
Judging from the following, 5 digits seem significant.
100^(1:2)
# [1] 100 10000
100^(1:3)
# [1] 1e+02 1e+04 1e+06
So my questions then are:
Why is scientific notation activated between the 4th and 5th power for 10 and not for other numbers? Is the number 5 significant? Furthermore, why 5 and not a number closer to the maximum digits option of 22?