Skip to content

Commit 3c8ec0e

Browse files
committed
wrapper added for minmax
1 parent 9e9c7fa commit 3c8ec0e

File tree

4 files changed

+9
-3
lines changed

4 files changed

+9
-3
lines changed

lib/node_modules/@stdlib/math/base/special/minmax/benchmark/c/native/benchmark.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ static double benchmark( void ) {
104104

105105
t = tic();
106106
for ( i = 0; i < ITERATIONS; i++ ) {
107-
stdlib_base_minmax( x1[ i % 100 ], x2[ i % 100 ], &y, 1, 0 );
107+
minmax( x1[ i % 100 ], x2[ i % 100 ] );
108108
if ( y != y ) {
109109
printf( "should not return NaN\n" );
110110
break;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ int main(void) {
2727
int i;
2828
for ( i = 0; i < 10; i++ ) {
2929
double out[] = { 0.0, 0.0 };
30-
stdlib_base_minmax( x1[ i ], x2[ i ], &out, 1, 0 );
30+
minmax( x1[ i ], x2[ i ] );
3131
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] );
3232
}
3333
}

lib/node_modules/@stdlib/math/base/special/minmax/src/addon.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@
2020
#include "stdlib/math/base/napi/binary.h"
2121

2222
// cppcheck-suppress shadowFunction
23-
STDLIB_MATH_BASE_NAPI_MODULE_DD_D( stdlib_base_minmax )
23+
STDLIB_MATH_BASE_NAPI_MODULE_DD_D( minmax )

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@
3737
* // returns [ -5.0, 4.0 ]
3838
*/
3939

40+
double minmax(double x, double y) {
41+
double result[2];
42+
stdlib_base_minmax(x, y, &result, 1, 0);
43+
return *result;
44+
}
45+
4046

4147
double stdlib_base_minmax( const double x, const double y, double* out, int stride, int offset ) {
4248

0 commit comments

Comments
 (0)