Engine API Reference - v2.24.0-beta.33
    Preparing search index...

    Function isPowerOfTwo

    • Returns true if argument is a power-of-two and false otherwise.

      Parameters

      • x: number

        Number to check for power-of-two property.

      Returns boolean

      true if power-of-two and false otherwise.

      math.isPowerOfTwo(32); // returns true
      math.isPowerOfTwo(17); // returns false