Compute a lower bound for 100*log10(c) for a positive integer c.
(c, correction = {
'1': 100, '2': 70, '3': 53, '4': 40, '5': 31,
'6': 23, '7': 16, '8': 10, '9': 5})
| 5981 | return coeff, exp |
| 5982 | |
| 5983 | def _log10_lb(c, correction = { |
| 5984 | '1': 100, '2': 70, '3': 53, '4': 40, '5': 31, |
| 5985 | '6': 23, '7': 16, '8': 10, '9': 5}): |
| 5986 | """Compute a lower bound for 100*log10(c) for a positive integer c.""" |
| 5987 | if c <= 0: |
| 5988 | raise ValueError("The argument to _log10_lb should be nonnegative.") |
| 5989 | str_c = str(c) |
| 5990 | return 100*len(str_c) - correction[str_c[0]] |
| 5991 | |
| 5992 | ##### Helper Functions #################################################### |
| 5993 |
no test coverage detected
searching dependent graphs…