Skip to content

Commit 6f2ed2e

Browse files
committed
feat: add readme contain for c implementation
--- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: passed - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent 1bdb7c8 commit 6f2ed2e

File tree

1 file changed

+96
-2
lines changed
  • lib/node_modules/@stdlib/math/base/special/minmaxf

1 file changed

+96
-2
lines changed

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

Lines changed: 96 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ limitations under the License.
2020

2121
# minmaxf
2222

23-
> Return the minimum and maximum values.
23+
> Return the minimum and maximum values for single-precision floating-point number.
2424
2525
<!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->
2626

@@ -42,7 +42,7 @@ var minmaxf = require( '@stdlib/math/base/special/minmaxf' );
4242

4343
#### minmaxf( x, y )
4444

45-
Returns the minimum and maximum values in a single pass.
45+
Returns the minimum and maximum values in a single pass for single-precision floating-point number.
4646

4747
```javascript
4848
var v = minmaxf( 4.0, 3.0 );
@@ -119,6 +119,100 @@ for ( i = 0; i < 100; i++ ) {
119119

120120
<!-- /.examples -->
121121

122+
<!-- C interface documentation. -->
123+
124+
* * *
125+
126+
<section class="c">
127+
128+
## C APIs
129+
130+
<!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->
131+
132+
<section class="intro">
133+
134+
</section>
135+
136+
<!-- /.intro -->
137+
138+
<!-- C usage documentation. -->
139+
140+
<section class="usage">
141+
142+
### Usages
143+
144+
```c
145+
#include "stdlib/math/base/special/minmaxf.h"
146+
```
147+
148+
#### stdlib_base_minmaxf( x, y, min, max )
149+
150+
Returns the minimum and maximum for single-precision floating-point number.
151+
152+
```c
153+
float min;
154+
float max;
155+
stdlib_base_minmaxf( 3.2, 4.1, &min, &max );
156+
157+
stdlib_base_minmaxf( 0.0f, -0.0f, &min, &max );
158+
```
159+
160+
The function accepts the following arguments:
161+
162+
- **x**: `[in] float` input value.
163+
- **y**: `[in] float` input value.
164+
- **min**: `[in] *float` output min.
165+
- **max**: `[in] *float` output max.
166+
167+
```c
168+
void stdlib_base_minmaxf( const float x, const float y, float* min, float* max );
169+
```
170+
171+
</section>
172+
173+
<!-- /.usage -->
174+
175+
<!-- C API usage notes. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
176+
177+
<section class="notes">
178+
179+
</section>
180+
181+
<!-- /.notes -->
182+
183+
<!-- C API usage examples. -->
184+
185+
<section class="examples">
186+
187+
### Examples
188+
189+
```c
190+
#include "stdlib/math/base/special/minmaxf.h"
191+
#include <stdio.h>
192+
193+
int main(void) {
194+
const float x1[] = { 1.0, 0.45, -0.89, 0.0 / 0.0, -0.78, -0.22, 0.66, 0.11, -0.55, 0.0 };
195+
const float x2[] = { -0.22, 0.66, 0.0, -0.55, 0.33, 1.0, 0.0 / 0.0, 0.11, 0.45, -0.78 };
196+
197+
float min;
198+
float max;
199+
int i;
200+
201+
for ( i = 0; i < 10; i++ ) {
202+
stdlib_base_minmaxf( x1[i], x2[i], &min, &max);
203+
printf( "x1[ %d ]: %f, x2[ %d ]: %f, minmaxf( x1[ %d ], x2[ %d ] ): ( %f, %f )\n", i, x1[ i ], i, x2[ i ], i, i, min, max );
204+
}
205+
}
206+
```
207+
208+
</section>
209+
210+
<!-- /.examples -->
211+
212+
</section>
213+
214+
<!-- /.c -->
215+
122216
<!-- Section to include cited references. If references are included, add a horizontal rule *before* the section. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
123217
124218
<section class="references">

0 commit comments

Comments
 (0)