Sorry to reply again, but I just realised that there was a think-o in my post above which corrected, addresses your objection.
"0.5e-$p" should be "0.00000000000005e-$p":
sub rnd{
my( $p, $n ) = @_;
return sprintf "%.${p}f", $n + "0.00000000000005e-$p"
};;
print $_, ': ', rnd( 5, $_ ) for
0.000005, 0.000015, 0.000025,
0.00003, 0.000031, 0.000032, 0.000033, 0.000034,
0.0000341, 0.0000342, 0.0000343,0.0000344, 0.0000345,
0.0000346, 0.0000347, 0.0000348, 0.0000349,
0.00003499, 0.000034999, 0.0000349999, 0.00003499999, 0.0000349999
+99,
0.0000349999999, 0.00003499999999, 0.000034999999999,
0.000035, 0.000045,
0.000055, 0.000065, 0.000075, 0.000085,
0.00009, 0.000091, 0.000092, 0.000093, 0.000094,
0.0000941, 0.0000942, 0.0000943,0.0000944, 0.0000945,
0.0000946, 0.0000947, 0.0000948, 0.0000949,
0.00009499, 0.000094999, 0.0000949999, 0.00009499999, 0.0000949999
+99,
0.0000949999999, 0.00009499999999, 0.000094999999999,
0.000095,;;
c:\test>junk
5e-006: 0.00001
1.5e-005: 0.00002
2.5e-005: 0.00003
3e-005: 0.00003
3.1e-005: 0.00003
3.2e-005: 0.00003
3.3e-005: 0.00003
3.4e-005: 0.00003
3.41e-005: 0.00003
3.42e-005: 0.00003
3.43e-005: 0.00003
3.44e-005: 0.00003
3.45e-005: 0.00003
3.46e-005: 0.00003
3.47e-005: 0.00003
3.48e-005: 0.00003
3.49e-005: 0.00003
3.499e-005: 0.00003
3.4999e-005: 0.00003
3.49999e-005: 0.00003
3.499999e-005: 0.00003
3.4999999e-005: 0.00003
3.49999999e-005: 0.00003
3.499999999e-005: 0.00003
3.4999999999e-005: 0.00003
3.5e-005: 0.00004
4.5e-005: 0.00005
5.5e-005: 0.00006
6.5e-005: 0.00007
7.5e-005: 0.00008
8.5e-005: 0.00009
9e-005: 0.00009
9.1e-005: 0.00009
9.2e-005: 0.00009
9.3e-005: 0.00009
9.4e-005: 0.00009
9.41e-005: 0.00009
9.42e-005: 0.00009
9.43e-005: 0.00009
9.44e-005: 0.00009
9.45e-005: 0.00009
9.46e-005: 0.00009
9.47e-005: 0.00009
9.48e-005: 0.00009
9.49e-005: 0.00009
9.499e-005: 0.00009
9.4999e-005: 0.00009
9.49999e-005: 0.00009
9.499999e-005: 0.00009
9.4999999e-005: 0.00009
9.49999999e-005: 0.00009
9.499999999e-005: 0.00009
9.4999999999e-005: 0.00009
9.5e-005: 0.00010
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
|