You are here: Symbol Reference > Dew Namespace > Dew.Math Namespace > Dew.Math.Units Namespace > Classes > Math387 Class > Math387 Methods > Math387.LargestExp2 Method
Dew Math for .NET
ContentsIndexHome
PreviousUpNext
Math387.LargestExp2 Method

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

Syntax
C#
Visual Basic
public static int LargestExp2(int n);

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

It is much faster than the call of: 

Exp2(Ceil(Log2(n)))  

Copyright (c) 1999-2022 by Dew Research. All rights reserved.
What do you think about this topic? Send feedback!