numerics#
- class cosmicjellyfish.utilities.utils.numerics[source]#
Bases:
object- static round_decimals_up(number, decimals=2, precision=5)[source]#
Returns a value rounded up to a specific number of decimal places.
- static bisection(array, value)[source]#
Given an
array, and given avalue, returns an index j such thatvalueis between array[j] and array[j+1].arraymust be monotonic increasing. Returns 0 if value is less than or equal to the first element, and len(array)-1 if value is greater than or equal to the last element.