Here you can find the source of ceilToPowerOfTwo(float value)
Parameter | Description |
---|---|
value | a parameter |
public static int ceilToPowerOfTwo(float value)
//package com.java2s; //License from project: Open Source License public class Main { /**// www. ja v a 2s . c om * Ceils the given value to the closest number that's is a power * of two. * @param value * @returns closest number that's a power of two */ public static int ceilToPowerOfTwo(float value) { int size = 2; while (size < value) { size *= 2; } return size; } }