If you use the gnuplot format specifiers %t
and %T
, you will observe some inconsistent behaviour.
### gnuplot format specifiers
Numbers = "94 95 99 100 101"
do for [n in Numbers] {
print gprintf("%3g",n)." = ".gprintf("%t",n)." x 10^".gprintf("%T",n)
}
Mantissa(n) = real(n)/10**floor(log10(n))
Power(n) = floor(log10(n))
do for [n in Numbers] {
print gprintf("%3g",n)." = ",Mantissa(n)," x 10^",Power(n)
}
### end of code
Result:
94 = 9.400000 x 10^1
95 = 0.950000 x 10^2
99 = 0.990000 x 10^2
100 = 1.000000 x 10^2
101 = 1.010000 x 10^2
94 = 9.4 x 10^1
95 = 9.5 x 10^1
99 = 9.9 x 10^1
100 = 1.0 x 10^2
101 = 1.01 x 10^2
Why, for example, is 95
shown as 0.95 x 10^2
instead of 9.5 x 10^1
?
What is the reasoning behind this?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…