threeML.utils.power_of_two_utils module

threeML.utils.power_of_two_utils.is_power_of_2(num)[source]

Returns whether num is a power of two or not :param num: an integer positive number :return: True if num is a power of 2, False otherwise

threeML.utils.power_of_two_utils.next_power_of_2(x)[source]

Returns the first power of two >= x, so f(2) = 2, f(127) = 128, f(65530) = 65536

Parameters:

x

Returns: