summaryrefslogtreecommitdiff
path: root/math_utils.py
diff options
context:
space:
mode:
authorScott Gasch <[email protected]>2022-02-08 17:46:56 -0800
committerScott Gasch <[email protected]>2022-02-08 17:46:56 -0800
commite8fbbb7306430478dec55d2c963eed116d8330cc (patch)
tree28c61b43d11df95b0d70d7f12eba139e02a3942e /math_utils.py
parent0d63d44ac89aab38fe95f36497adaf95110ab949 (diff)
More cleanup, yey!
Diffstat (limited to 'math_utils.py')
-rw-r--r--math_utils.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/math_utils.py b/math_utils.py
index 3953ae5..37fcec5 100644
--- a/math_utils.py
+++ b/math_utils.py
@@ -1,5 +1,7 @@
#!/usr/bin/env python3
+"""Mathematical helpers."""
+
import functools
import math
from heapq import heappop, heappush
@@ -76,8 +78,8 @@ def truncate_float(n: float, decimals: int = 2):
3.141
"""
- assert decimals > 0 and decimals < 10
- multiplier = 10 ** decimals
+ assert 0 < decimals < 10
+ multiplier = 10**decimals
return int(n * multiplier) / multiplier