diff --git a/base/special/xlogy/README.md b/base/special/xlogy/README.md index d3bea1f59..84b7f0c75 100644 --- a/base/special/xlogy/README.md +++ b/base/special/xlogy/README.md @@ -89,6 +89,96 @@ for ( i = 0; i < 100; i++ ) { + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +#include "stdlib/math/base/special/xlogy.h" +``` + +#### stdlib_base_xlogy( x, y ) + +Computes `x * ln(y)` so that the result is `0` if `x = 0`. + +```c +double v = stdlib_base_xlogy( 3.0, 2.0 ); +// returns ~2.079 +``` + +The function accepts the following arguments: + +- **x**: `[in] double` input value. +- **y**: `[in] double` input value. + +```c +double stdlib_base_xlogy( const double x, const double y ); +``` + +
+ + + + + +
+ +
+ + + + + +
+ +### Examples + +```c +#include "stdlib/math/base/special/xlogy.h" +#include +#include + +int main( void ) { + double out; + double x; + double y; + int i; + + for ( i = 0; i < 100; i++ ) { + x = ( (double)rand() / (double)RAND_MAX ) * 100.0; + y = ( (double)rand() / (double)RAND_MAX ) * 5.0; + out = stdlib_base_xlogy( x, y ); + printf( "xlogy(%lf, %lf) = %lf\n", x, y, out ); + } +} +``` + +
+ + + +
+ + +