Skip to content

Commit 62d64a2

Browse files
committed
fix: fixing examples and benchmark
1 parent a98c826 commit 62d64a2

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
lines changed

Diff for: lib/node_modules/@stdlib/math/base/special/minmaxn/benchmark/c/native/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -143,4 +143,4 @@ run: $(c_targets)
143143
clean:
144144
$(QUIET) -rm -f *.o *.out
145145

146-
.PHONY: clean
146+
.PHONY: clean

Diff for: lib/node_modules/@stdlib/math/base/special/minmaxn/benchmark/c/native/benchmark.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ static double benchmark( void ) {
107107
for ( i = 0; i < ITERATIONS; i++ ) {
108108
args[ 0 ] = x1[ i % 100 ];
109109
args[ 1 ] = x2[ i % 100 ];
110-
stdlib_base_minmaxn( args, out );
110+
stdlib_base_minmaxn( args, out, 2 );
111111
if ( out[ 0 ] != out[ 0 ] || out[ 1 ] != out[ 1 ] ) {
112112
printf( "should not return NaN\n" );
113113
break;
@@ -138,4 +138,4 @@ int main( void ) {
138138
printf( "ok %d benchmark finished\n", i+1 );
139139
}
140140
print_summary( REPEATS, REPEATS );
141-
}
141+
}

Diff for: lib/node_modules/@stdlib/math/base/special/minmaxn/examples/c/example.c

+3-6
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,14 @@ int main(void) {
2323
const double x1[] = { 1.0, 0.45, -0.89, 0.0 / 0.0, -0.78, -0.22, 0.66, 0.11, -0.55, 0.0 };
2424
const double x2[] = { -0.22, 0.66, 0.0, -0.55, 0.33, 1.0, 0.0 / 0.0, 0.11, 0.45, -0.78 };
2525

26-
double min;
27-
double max;
2826
double args[ 2 ];
29-
double out[ 2 ];
27+
double out[ 2 ] = { 0.0, 0.0 };
3028
int i;
3129

32-
out = [ 0.0, 0.0 ];
3330
for ( i = 0; i < 10; i++ ) {
3431
args[ 0 ] = x1[ i ];
3532
args[ 1 ] = x2[ i ];
36-
stdlib_base_minmaxn( args, out );
33+
stdlib_base_minmaxn( args, out, 2 );
3734
printf( "x1[ %d ]: %lf, x2[ %d ]: %lf, minmax( x1[ %d ], x2[ %d ] ): ( %lf, %lf )\n", i, x1[ i ], i, x2[ i ], i, i, out[ 0 ], out[ 1 ] );
3835
}
39-
}
36+
}

0 commit comments

Comments
 (0)