Skip to content

Commit 15cb501

Browse files
committed
suggested changes made
1 parent 89ffc42 commit 15cb501

File tree

1 file changed

+14
-11
lines changed
  • lib/node_modules/@stdlib/math/base/special/minmax

1 file changed

+14
-11
lines changed

lib/node_modules/@stdlib/math/base/special/minmax/README.md

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
@license Apache-2.0
44
5-
Copyright (c) 2024 The Stdlib Authors.
5+
Copyright (c) 2018 The Stdlib Authors.
66
77
Licensed under the Apache License, Version 2.0 (the "License");
88
you may not use this file except in compliance with the License.
@@ -146,16 +146,18 @@ for ( i = 0; i < 100; i++ ) {
146146
#include "stdlib/math/base/special/minmax.h"
147147
```
148148

149-
#### stdlib_base_minmax( x, y )
149+
#### stdlib_base_minmax( x, y, &min, &max )
150150

151-
Returns the minimum and maximum value.
151+
Gives the minimum and maximum value.
152152

153153
```c
154-
double out = stdlib_base_minmax( 4.2, 3.14 );
155-
// returns [ 3.14, 4.2 ]
154+
double min;
155+
double max;
156+
stdlib_base_minmax( 4.2, 3.14, &min, &max );
157+
// min = 3.14, max = 4.2
156158

157-
out = stdlib_base_minmax( 0.0, -0.0 );
158-
// returns [ -0.0, 0.0 ]
159+
stdlib_base_minmax( 0.0, -0.0, &min, &max );
160+
// min = -0.0, max = 0.0
159161
```
160162
161163
The function accepts the following arguments:
@@ -164,7 +166,7 @@ The function accepts the following arguments:
164166
- **y**: `[in] double` input value.
165167
166168
```c
167-
double stdlib_base_minmax( const double x, const double y );
169+
double stdlib_base_minmax( const double x, const double y, double* min, double* max );
168170
```
169171

170172
</section>
@@ -193,14 +195,15 @@ double stdlib_base_minmax( const double x, const double y );
193195
int main( void ) {
194196
double x;
195197
double y;
196-
double v;
198+
double min;
199+
double max;
197200
int i;
198201

199202
for ( i = 0; i < 100; i++ ) {
200203
x = ( ( (double)rand() / (double)RAND_MAX ) * 200.0 ) - 100.0;
201204
y = ( ( (double)rand() / (double)RAND_MAX ) * 200.0 ) - 100.0;
202-
v = stdlib_base_minmax( x, y );
203-
printf( "x: %lf, y: %lf, minmax(x, y): [ %lf, %lf ]\n", x, y, v[0], v[1] );
205+
stdlib_base_minmax( x, y, &min, &max );
206+
printf( "x: %lf, y: %lf, minmax(x, y): [ %lf, %lf ]\n", x, y, min, max );
204207
}
205208
}
206209
```

0 commit comments

Comments
 (0)