math.py 294 B

12345678
  1. # Copyright (C) 2009-2016, Panagiotis Christopoulos Charitos and contributors.
  2. # All rights reserved.
  3. # Code licensed under the BSD License.
  4. # http://www.anki3d.org/LICENSE
  5. # keep methods in alphabetical order
  6. def is_power_of_two(number):
  7. return ((number & (number - 1)) == 0) and number != 0