Rounding up to the nearest exact logarithmic decade
jao at geophile.com
jao at geophile.com
Tue Feb 28 17:47:59 EST 2006
More information about the Python-list mailing list
Tue Feb 28 17:47:59 EST 2006
- Previous message (by thread): Rounding up to the nearest exact logarithmic decade
- Next message (by thread): Rounding up to the nearest exact logarithmic decade
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Quoting Derek Basch <dbasch at yahoo.com>: > 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: How about this: def roundup(x): if x < 1: return 1 else: return '1' + ('0' * len(str(int(x)))) Jack Orenstein
- Previous message (by thread): Rounding up to the nearest exact logarithmic decade
- Next message (by thread): Rounding up to the nearest exact logarithmic decade
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list