math/ pow2.bi | |
License | Copyright © 2009, FreeBASIC Extended Library Development Group |
ext.math | |
Functions | |
NextPow2 | Finds the next power of 2 after a number. |
RoundPow2 | Finds the next power of 2 after a number only if the number passed is not a power of 2 already. |
IsPow2 | Determines if the number passed is a power of 2. |
Copyright © 2009, FreeBASIC Extended Library Development Group
Distributed under the FreeBASIC Extended Library Group license. See accompanying file LICENSE.txt or copy at http://code.google.com- /p- /fb-extended-lib- /wiki- /License
declare function RoundPow2 overload ( byval n as fbext_TypeName(NumericType_) ) as fbext_TypeName(NumericType_)
Finds the next power of 2 after a number only if the number passed is not a power of 2 already.
Overloaded to work with all numeric types.
ds | the number to find the next power of 2 after. |
The next power of 2 if ds is not a power of 2, ds otherwise.
Finds the next power of 2 after a number.
declare function NextPow2 overload ( byval ds as fbext_TypeName(NumericType_) ) as fbext_TypeName(NumericType_)
Finds the next power of 2 after a number only if the number passed is not a power of 2 already.
declare function RoundPow2 overload ( byval n as fbext_TypeName(NumericType_) ) as fbext_TypeName(NumericType_)
Determines if the number passed is a power of 2.
declare function IsPow2 overload ( byval n as fbext_TypeName(NumericType_) ) as ext.bool