Skip to content

Commit 4c152fd

Browse files
docs: fix C examples
--- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown_pkg_readmes status: passed - task: lint_markdown_docs status: na - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: passed - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent 187ce19 commit 4c152fd

18 files changed

Lines changed: 51 additions & 22 deletions

File tree

lib/node_modules/@stdlib/blas/base/cgemv/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ float y[] = { 1.0f, 1.0f, 2.0f, 2.0f, 3.0f, 3.0f, 4.0f, 4.0f };
309309
const stdlib_complex64_t alpha = stdlib_complex64( 0.5f, 0.5f );
310310
const stdlib_complex64_t beta = stdlib_complex64( 0.5f, -0.5f );
311311

312-
c_cgemv( CblasNoTrans, 4, 2, alpha, (void *)A, 1, 4, (void *)x, 1, 0, beta, (void *)y, 1, 0 );
312+
c_cgemv_ndarray( CblasNoTrans, 4, 2, alpha, (void *)A, 1, 4, 0, (void *)x, 1, 0, beta, (void *)y, 1, 0 );
313313
```
314314
315315
The function accepts the following arguments:

lib/node_modules/@stdlib/blas/ext/base/dnancount/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ console.log( v );
177177
Computes the number of non-`NaN` elements in a double-precision floating-point strided array.
178178

179179
```c
180-
const double x[] = { 1.0, 2.0, NaN, 4.0, 5.0, 6.0, NaN, 8.0 };
180+
const double x[] = { 1.0, 2.0, 0.0/0.0, 4.0, 5.0, 6.0, 0.0/0.0, 8.0 };
181181

182182
int v = stdlib_strided_dnancount( 4, x, 2 );
183183
// returns 2
@@ -198,7 +198,7 @@ CBLAS_INT stdlib_strided_dnancount( const CBLAS_INT N, const double *X, const CB
198198
Computes the number of non-`NaN` elements in a double-precision floating-point strided array using alternative indexing semantics.
199199

200200
```c
201-
const double x[] = { 2.0, 1.0, NaN, -2.0, 3.0, 4.0, NaN, NaN };
201+
const double x[] = { 2.0, 1.0, 0.0/0.0, -2.0, 3.0, 4.0, 0.0/0.0, 0.0/0.0 };
202202

203203
int v = stdlib_strided_dnancount_ndarray( 4, x, 2, 1 );
204204
// returns 3

lib/node_modules/@stdlib/blas/ext/base/znancount/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -190,9 +190,9 @@ Computes the number of non-`NaN` elements in a double-precision complex floating
190190

191191
const stdlib_complex128_t x[] = {
192192
stdlib_complex128( 2.0, 1.0 ),
193-
stdlib_complex128( NaN, -2.0 ),
193+
stdlib_complex128( 0.0/0.0, -2.0 ),
194194
stdlib_complex128( 3.0, 4.0 ),
195-
stdlib_complex128( NaN, NaN )
195+
stdlib_complex128( 0.0/0.0, 0.0/0.0 )
196196
};
197197

198198
int v = stdlib_strided_znancount( 4, x, 1 );
@@ -218,9 +218,9 @@ Computes the number of non-`NaN` elements in a double-precision complex floating
218218
219219
const stdlib_complex128_t x[] = {
220220
stdlib_complex128( 2.0, 1.0 ),
221-
stdlib_complex128( NaN, -2.0 ),
221+
stdlib_complex128( 0.0/0.0, -2.0 ),
222222
stdlib_complex128( 3.0, 4.0 ),
223-
stdlib_complex128( NaN, NaN )
223+
stdlib_complex128( 0.0/0.0, 0.0/0.0 )
224224
};
225225
226226
int v = stdlib_strided_znancount_ndarray( 4, x, 1, 0 );

lib/node_modules/@stdlib/math/base/assert/is-composite/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ bool = isComposite( NaN );
103103
### Usage
104104

105105
```c
106-
#include "stdlib/math/base/special/is_composite.h"
106+
#include "stdlib/math/base/assert/is_composite.h"
107107
```
108108

109109
#### stdlib_base_is_composite( x )

lib/node_modules/@stdlib/math/base/special/atan2/src/main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,11 @@
7171
* // returns 0.0
7272
*
7373
* @example
74-
* double v = stdlib_base_atan2( 3.0, NaN );
74+
* double v = stdlib_base_atan2( 3.0, 0.0/0.0 );
7575
* // returns NaN
7676
*
7777
* @example
78-
* double v = stdlib_base_atan2( NaN, 2.0 );
78+
* double v = stdlib_base_atan2( 0.0/0.0, 2.0 );
7979
* // returns NaN
8080
*/
8181
double stdlib_base_atan2( const double y, const double x ) {

lib/node_modules/@stdlib/math/base/special/atan2d/src/main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,11 @@
5151
* // returns 0.0
5252
*
5353
* @example
54-
* double v = stdlib_base_atan2d( 3.0, NaN );
54+
* double v = stdlib_base_atan2d( 3.0, 0.0/0.0 );
5555
* // returns NaN
5656
*
5757
* @example
58-
* double v = stdlib_base_atan2d( NaN, 2.0 );
58+
* double v = stdlib_base_atan2d( 0.0/0.0, 2.0 );
5959
* // returns NaN
6060
*/
6161
double stdlib_base_atan2d( const double y, const double x ) {

lib/node_modules/@stdlib/math/base/special/cround/src/main.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,12 @@
3535
* stdlib_complex128_t z = stdlib_complex128( -4.2, 5.5 );
3636
*
3737
* stdlib_complex128_t out = stdlib_base_cround( z );
38-
* // returns <Complex128>[ -5.0, 6.0 ]
38+
*
39+
* double re = stdlib_complex128_real( out );
40+
* // returns -4.0
41+
*
42+
* double im = stdlib_complex128_imag( out );
43+
* // returns 6.0
3944
*/
4045
stdlib_complex128_t stdlib_base_cround( const stdlib_complex128_t z ) {
4146
double re;

lib/node_modules/@stdlib/math/base/special/fast/max/src/main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@
3030
* // returns 4.2
3131
*
3232
* @example
33-
* double v = stdlib_base_fast_max( 3.14, NaN );
33+
* double v = stdlib_base_fast_max( 3.14, 0.0/0.0 );
3434
* // returns NaN
3535
*
3636
* @example
37-
* double v = stdlib_base_fast_max( NaN, 3.14 );
37+
* double v = stdlib_base_fast_max( 0.0/0.0, 3.14 );
3838
* // returns 3.14
3939
*
4040
* @example

lib/node_modules/@stdlib/math/base/special/gcd/src/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ static const int64_t STDLIB_CONSTANT_INT64_MAX = 9223372036854775807;
3535
* @return greatest common divisor
3636
*
3737
* @example
38-
* double out = largeIntegers( 1.2676506002282294.0e+30, 9007199254740992.0 );
38+
* double out = largeIntegers( 1.2676506002282294e+30, 9007199254740992.0 );
3939
* // returns 9007199254740992.0
4040
*/
4141
static double largeIntegers( const double a, const double b ) {

lib/node_modules/@stdlib/math/base/special/pow/src/main.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -377,9 +377,11 @@ static double pow2( uint32_t j, const double hp, const double lp ) {
377377
* @param o2 destination for output2
378378
*
379379
* @example
380+
* double o1;
381+
* double o2;
380382
* logx( 9.0, &o1, &o2 );
381383
*/
382-
void logx( const double ax, double *o1, double *o2 ) {
384+
static void logx( const double ax, double *o1, double *o2 ) {
383385
double t2;
384386
double t1;
385387
double t;
@@ -408,9 +410,11 @@ void logx( const double ax, double *o1, double *o2 ) {
408410
* @param o2 destination for output2
409411
*
410412
* @example
413+
* double o1;
414+
* double o2;
411415
* log2ax( 9.0, 1075970048, &o1, &o2 );
412416
*/
413-
void log2ax( const double ax, const int32_t ahx, double *o1, double *o2 ) {
417+
static void log2ax( const double ax, const int32_t ahx, double *o1, double *o2 ) {
414418
uint32_t ahxcc;
415419
uint32_t tmp;
416420
int32_t ahxc;

0 commit comments

Comments
 (0)