Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


IsPowerOfTwo(int)

Returns true if a positive value is a non-zero power of two.
Read time 1 minuteLast updated 16 days ago

Definition

  • Type: Method
  • Namespace: Unity.Collections
  • Assembly: UnityEngine.ManagedKernelModule
public static bool IsPowerOfTwo(int value)

Parameters

value

A positive value.

Returns

Type

Description

boolTrue if the value is a non-zero, positive power of two.

Remarks

Result is invalid if
value < 0
.