Math387.LargestExp2 Method

function LargestExp2(n: integer): integer; overload;

Returns first number being power of two that is equal or greater than n.

#NameTypeDescription
1ninteger

Returns: integer - the first number being power of two that is equal or greater than n.

Remarks:

It is much faster than the call of:

Exp2(Ceil(Log2(n)))

See Also: Math387.LargestLog2