Skip to content

Commit 22fbadb

Browse files
committed
fix: updating example.c
1 parent 7797246 commit 22fbadb

File tree

1 file changed

+3
-4
lines changed
  • lib/node_modules/@stdlib/math/base/special/minmaxn/examples/c

1 file changed

+3
-4
lines changed

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,13 @@ 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 args[ 2 ];
2726
double out[ 2 ] = { 0.0, 0.0 };
2827
int i;
2928

3029
for ( i = 0; i < 10; i++ ) {
31-
args[ 0 ] = x1[ i ];
32-
args[ 1 ] = x2[ i ];
33-
stdlib_base_minmaxn( args, out, 2 );
30+
const double args[ 2 ] = { x1[ i ], x2[ i ] };
31+
32+
stdlib_base_minmaxn( out, args, 2 );
3433
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 ] );
3534
}
3635
}

0 commit comments

Comments
 (0)