diff --git a/base/special/log/README.md b/base/special/log/README.md index fb508d9d2..57756de9e 100644 --- a/base/special/log/README.md +++ b/base/special/log/README.md @@ -2,7 +2,7 @@ @license Apache-2.0 -Copyright (c) 2018 The Stdlib Authors. +Copyright (c) 2024 The Stdlib Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -85,6 +85,96 @@ for ( i = 0; i < 100; i++ ) { + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +#include "stdlib/math/base/special/log.h" +``` + +#### stdlib_base_log( x, b ) + +Computes the base `b` logarithm of `x`. + +```c +double v = stdlib_base_log( 100.0, 10.0 ); +// returns 2.0 +``` + +The function accepts the following arguments: + +- **x**: `[in] double` input value. +- **b**: `[in] double` input value. + +```c +double stdlib_base_log( const double x, const double b ); +``` + +
+ + + + + +
+ +
+ + + + + +
+ +### Examples + +```c +#include "stdlib/math/base/special/log.h" +#include +#include + +int main( void ) { + double out; + double x; + double b; + int i; + + for ( i = 0; i < 100; i++ ) { + x = ( (double)rand() / (double)RAND_MAX ) * 100.0; + b = ( (double)rand() / (double)RAND_MAX ) * 5.0; + out = stdlib_base_log( x, b ); + printf( "log(%lf, %lf) = %lf\n", x, b, out ); + } +} +``` + +
+ + + +
+ + +