From 9c9ed39870107e246e7bcd64e1238f42485514f5 Mon Sep 17 00:00:00 2001 From: Pranavchiku Date: Tue, 20 Dec 2022 10:11:45 +0530 Subject: [PATCH 01/20] add c-api documentation in readme --- .../@stdlib/math/base/special/log10/README.md | 94 ++++++++++++++++++- 1 file changed, 92 insertions(+), 2 deletions(-) diff --git a/lib/node_modules/@stdlib/math/base/special/log10/README.md b/lib/node_modules/@stdlib/math/base/special/log10/README.md index f8f9f577e3e4..7f91e9c0f4a2 100644 --- a/lib/node_modules/@stdlib/math/base/special/log10/README.md +++ b/lib/node_modules/@stdlib/math/base/special/log10/README.md @@ -2,7 +2,7 @@ @license Apache-2.0 -Copyright (c) 2018 The Stdlib Authors. +Copyright (c) 2022 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. @@ -57,7 +57,7 @@ Evaluates the [common logarithm][common-logarithm]. ```javascript var v = log10( 100.0 ); -// returns 2.0 +// returns ~2.0 v = log10( 8.0 ); // returns ~0.903 @@ -107,6 +107,96 @@ for ( i = 0; i < 100; i++ ) { + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +#include "stdlib/math/base/special/log10.h" +``` + +#### stdlib_base_log10( x ) + +Evaluates the [common logarithm][common-logarithm]. + +```c +double out = stdlib_base_log10( 100.0 ); +// returns ~2.0 + +out = stdlib_base_log10( 8.0 ); +// returns ~0.903 +``` + +The function accepts the following arguments: + +- **x**: `[in] double` input value. + +```c +double stdlib_base_log10( const double x ); +``` + +
+ + + + + +
+ +
+ + + + + +
+ +### Examples + +```c +#include "stdlib/math/base/special/log10.h" +#include +#include + +int main() { + double x; + double v; + int i; + + for ( i = 0; i < 100; i++ ) { + x = ( (double) rand() / (double) RAND_MAX ) * 100.0; + v = stdlib_base_log10( x ); + printf( "log10(%lf) = %lf\n", x, v ); + } +} +``` + +
+ + + +
+ + +