Mathf.NextPowerOfTwo Manual     Reference     Scripting  
Scripting > Runtime Classes > Mathf
Mathf.NextPowerOfTwo

static function NextPowerOfTwo (value : int) : int

Description

Returns the next power of two value

JavaScripts
using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
void Awake() {
Debug.Log(Mathf.NextPowerOfTwo(7));
Debug.Log(Mathf.NextPowerOfTwo(139));
}
}

import UnityEngine
import System.Collections

class example(MonoBehaviour):

def Awake():
Debug.Log(Mathf.NextPowerOfTwo(7))
Debug.Log(Mathf.NextPowerOfTwo(139))