From f477c9b3916977dc3297b7b496130b3fcf8227d8 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Sun, 3 Mar 2024 13:29:13 +0000 Subject: [PATCH] Auto-generated commit --- base/special/log/README.md | 92 +++++++++- .../special/log/benchmark/benchmark.native.js | 62 +++++++ base/special/log/benchmark/c/native/Makefile | 146 +++++++++++++++ .../log/benchmark/c/native/benchmark.c | 138 ++++++++++++++ base/special/log/binding.gyp | 170 ++++++++++++++++++ base/special/log/examples/c/Makefile | 146 +++++++++++++++ base/special/log/examples/c/example.c | 35 ++++ base/special/log/include.gypi | 53 ++++++ .../include/stdlib/math/base/special/log.h | 38 ++++ base/special/log/lib/native.js | 55 ++++++ base/special/log/manifest.json | 72 ++++++++ base/special/log/src/Makefile | 70 ++++++++ base/special/log/src/addon.c | 23 +++ base/special/log/src/main.c | 35 ++++ base/special/log/test/test.native.js | 91 ++++++++++ 15 files changed, 1225 insertions(+), 1 deletion(-) create mode 100644 base/special/log/benchmark/benchmark.native.js create mode 100644 base/special/log/benchmark/c/native/Makefile create mode 100644 base/special/log/benchmark/c/native/benchmark.c create mode 100644 base/special/log/binding.gyp create mode 100644 base/special/log/examples/c/Makefile create mode 100644 base/special/log/examples/c/example.c create mode 100644 base/special/log/include.gypi create mode 100644 base/special/log/include/stdlib/math/base/special/log.h create mode 100644 base/special/log/lib/native.js create mode 100644 base/special/log/manifest.json create mode 100644 base/special/log/src/Makefile create mode 100644 base/special/log/src/addon.c create mode 100644 base/special/log/src/main.c create mode 100644 base/special/log/test/test.native.js 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 ); + } +} +``` + +
+ + + +
+ + +