Skip to content
Snippets Groups Projects
Commit b70e63d8 authored by Izzard, Robert Dr (Maths & Physics)'s avatar Izzard, Robert Dr (Maths & Physics)
Browse files

convert max and min bounds to ints in const_int()

parent 391b952a
No related branches found
No related tags found
No related merge requests found
......@@ -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)
############################################################
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment