Round possible float number error, killing some precision in process.
(value)
| 17 | |
| 18 | |
| 19 | def floatUnerr(value): |
| 20 | """Round possible float number error, killing some precision in process.""" |
| 21 | if value in (0, math.inf): |
| 22 | return value |
| 23 | # Find round factor, taking into consideration that we want to keep at least |
| 24 | # predefined amount of significant digits |
| 25 | roundFactor = int(keepDigits - math.ceil(math.log10(abs(value)))) |
| 26 | return round(value, roundFactor) |
no outgoing calls
no test coverage detected