diff --git a/base/special/fast/abs/README.md b/base/special/fast/abs/README.md index 8efa9b869..cd3e839a5 100644 --- a/base/special/fast/abs/README.md +++ b/base/special/fast/abs/README.md @@ -114,6 +114,91 @@ for ( i = 0; i < 100; i++ ) { + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +#include "stdlib/math/base/special/fast/abs.h" +``` + +#### stdlib_base_fast_abs( x ) + +Computes the absolute value of a double-precision floating-point number. + +```c +double y = stdlib_base_fats_abs( -5.0 ); +// returns 5.0 +``` + +The function accepts the following arguments: + +- **x**: `[in] double` input value. + +```c +double stdlib_base_fast_abs( const double x ); +``` + +
+ + + + + +
+ +
+ + + + + +
+ +### Examples + +```c +#include "stdlib/math/base/special/fast/abs.h" +#include + +int main( void ) { + const double x[] = { 3.14, -3.14, 0.0, 0.0/0.0 }; + + double y; + int i; + for ( i = 0; i < 4; i++ ) { + y = stdlib_base_fast_abs( x[ i ] ); + printf( "|%lf| = %lf\n", x[ i ], y ); + } +} +``` + +
+ + + +
+ + +