diff --git a/lib/node_modules/@stdlib/math/base/special/fast/uint32-log2/README.md b/lib/node_modules/@stdlib/math/base/special/fast/uint32-log2/README.md index 76eaa5e2cc8..20c5b974447 100644 --- a/lib/node_modules/@stdlib/math/base/special/fast/uint32-log2/README.md +++ b/lib/node_modules/@stdlib/math/base/special/fast/uint32-log2/README.md @@ -88,6 +88,97 @@ for ( i = 1; i < 101; i++ ) { + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +#include "stdlib/math/base/special/fast/uint32_log2.h" +``` + +#### stdlib_base_fast_uint32_log2( x ) + +Returns an **approximate** [binary logarithm][binary-logarithm] of an unsigned 32-bit integer `x`. + +```c +#include + +uint32_t out = stdlib_base_fast_uint32_log2( 4 ); +// returns 2 + +out = stdlib_base_fast_uint32_log2( 9 ); +// returns 3 +``` + +The function accepts the following arguments: + +- **x**: `[in] uint32_t` input value. + +```c +uint32_t stdlib_base_fast_uint32_log2( const uint32_t x ); +``` + +
+ + + + + +
+ +
+ + + + + +
+ +### Examples + +```c +#include "stdlib/math/base/special/fast/uint32_log2.h" +#include +#include + +int main( void ) { + const uint32_t x[] = { 5, 7, 10, 22, 98 }; + + uint32_t y; + int i; + for ( i = 0; i < 5; i++ ) { + y = stdlib_base_fast_uint32_log2( x[ i ] ); + printf( "uint32_log2(%u) = %u\n", x[ i ], y ); + } +} +``` + +
+ + + +
+ + +