Skip to content

Commit 55a3989

Browse files
chore: updating examples
1 parent c97d8f9 commit 55a3989

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

lib/node_modules/@stdlib/math/base/special/minmax/examples/c/example.c

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,22 +17,17 @@
1717
*/
1818

1919
#include "stdlib/math/base/special/minmax.h"
20-
#include <stdlib.h>
2120
#include <stdio.h>
2221

2322
int main( void ) {
23+
const double x[] = { 1.0, 0.45, -0.89, 0.0 / 0.0, -0.78, -0.22, 0.66, 0.11, -0.55, 0.0 };
24+
const double y[] = { -0.22, 0.66, 0.0, -0.55, 0.33, 1.0, 0.0 / 0.0, 0.11, 0.45, -0.78 };
25+
2426
double min;
2527
double max;
26-
double x;
27-
double y;
2828
int i;
2929

30-
const double x[] = { 1.0, 0.45, -0.89, 0.0 / 0.0, -0.78, -0.22, 0.66, 0.11, -0.55, 0.0 };
31-
const double y[] = { -0.22, 0.66, 0.0, -0.55, 0.33, 1.0, 0.0 / 0.0, 0.11, 0.45, -0.78 };
32-
33-
for ( i = 0; i < 12; i++ ) {
34-
x = ( ( (double)rand() / (double)RAND_MAX ) * 200.0 ) - 100.0;
35-
y = ( ( (double)rand() / (double)RAND_MAX ) * 200.0 ) - 100.0;
30+
for ( i = 0; i < 10; i++ ) {
3631
stdlib_base_minmax( x[ i ], y[ i ], &min, &max );
3732
printf( "x: %lf => min: %lf, y: %lf, minmax(x, y): %lf\n", x[ i ], y[ i ], min, max );
3833
}

lib/node_modules/@stdlib/math/base/special/minmax/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,14 @@
1414
}
1515
],
1616
"main": "./lib",
17+
"gypfile": true,
1718
"directories": {
1819
"benchmark": "./benchmark",
1920
"doc": "./docs",
2021
"example": "./examples",
22+
"include": "./include",
2123
"lib": "./lib",
24+
"src": "./src",
2225
"test": "./test"
2326
},
2427
"types": "./docs/types",

0 commit comments

Comments
 (0)