diff --git a/base/special/fast/uint32-sqrt/README.md b/base/special/fast/uint32-sqrt/README.md index ec23c6d6f..231bdc308 100644 --- a/base/special/fast/uint32-sqrt/README.md +++ b/base/special/fast/uint32-sqrt/README.md @@ -92,6 +92,97 @@ for ( i = 0; i < 101; i++ ) { + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +#include "stdlib/math/base/special/fast/uint32_sqrt.h" +``` + +#### stdlib_base_fast_uint32_sqrt( x ) + +Compute an integer [square root][square-root]. + +```c +#include + +uint32_t out = stdlib_base_fast_uint32_sqrt( 2 ); +// returns 1 + +out = stdlib_base_fast_uint32_sqrt( 8 ); +// returns 3 +``` + +The function accepts the following arguments: + +- **x**: `[in] uint32_t` input value. + +```c +uint32_t stdlib_base_fast_uint32_sqrt( const uint32_t x ); +``` + +
+ + + + + +
+ +
+ + + + + +
+ +### Examples + +```c +#include "stdlib/math/base/special/fast/uint32_sqrt.h" +#include +#include + +int main( void ) { + const uint32_t x[] = { 10, 17, 20, 22, 98 }; + + uint32_t y; + int i; + for ( i = 0; i < 5; i++ ) { + y = stdlib_base_fast_uint32_sqrt( x[ i ] ); + printf( "uint32_sqrt(%u) = %u\n", x[ i ], y ); + } +} +``` + +
+ + + +
+ + +