Rounding up to the nearest exact logarithmic decade

Derek Basch dbasch at yahoo.com
Tue Feb 28 17:28:36 EST 2006


Given a value (x) that is within the range (1e-1, 1e7) how do I round
(x) up to the closest exact logarithmic decade? For instance:

10**3 = 1000
x = 4978
10**4 = 10000

x = 10000

Thanks Everyone!
Derek Basch




More information about the Python-list mailing list