diff --git a/binarycpython/utils/spacing_functions.py b/binarycpython/utils/spacing_functions.py index d4ae9c4c5025928282f53e89ab1873f86bcabde4..c3e0be388abf1320089604e61e8831a722480141 100644 --- a/binarycpython/utils/spacing_functions.py +++ b/binarycpython/utils/spacing_functions.py @@ -39,21 +39,21 @@ def const_int( Samples an integer range linearly. Returns a list of ints. Args: - min_bound: lower bound of range - max_bound: upper bound of range + min_bound: lower bound of range, must be an integer (is converted to int) + max_bound: upper bound of range, must be an integer (is converted to int) steps: number of segments between min_bound and max_bound Returns: range(min_bound,max_bound,step) - where step is int((max_bound-min_bound)/steps) + where step is int((int(max_bound)-int(min_bound))/steps) """ - step = int((max_bound-min_bound)/(steps-1)) + step = int((int(max_bound)-int(min_bound))/(steps-1)) if steps <= 1: - return min_bound + return int(min_bound) else: - return range(min_bound,max_bound+step,step) + return range(int(min_bound),int(max_bound+step),step) ############################################################