Skip to content

Commit aa5b36f

Browse files
committed
Auto-generated commit
1 parent 11d083b commit aa5b36f

28 files changed

Lines changed: 2602 additions & 0 deletions

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
### Features
1212

13+
- [`8fd6600`](https://github.com/stdlib-js/stdlib/commit/8fd66000cecd700c0ec8b503ea845dd03844ab87) - add `math/base/special/minmaxabsf` [(#7043)](https://github.com/stdlib-js/stdlib/pull/7043)
1314
- [`23b6d1a`](https://github.com/stdlib-js/stdlib/commit/23b6d1a76ac2fcfed45f24561fe32d59bae722b6) - add `math/base/special/modff` [(#7101)](https://github.com/stdlib-js/stdlib/pull/7101)
1415
- [`ee08533`](https://github.com/stdlib-js/stdlib/commit/ee085335f14c4586b37dfd8c0ad4a82113651777) - add `math/base/special/gamma-lanczos-sum-expg-scaledf`
1516
- [`fe35e83`](https://github.com/stdlib-js/stdlib/commit/fe35e83251890e69ae041104dfcefa9bcfbbd37a) - add C implementation for `math/base/special/minmaxabs` [(#6983)](https://github.com/stdlib-js/stdlib/pull/6983)
@@ -505,6 +506,7 @@ A total of 46 issues were closed in this release:
505506

506507
<details>
507508

509+
- [`8fd6600`](https://github.com/stdlib-js/stdlib/commit/8fd66000cecd700c0ec8b503ea845dd03844ab87) - **feat:** add `math/base/special/minmaxabsf` [(#7043)](https://github.com/stdlib-js/stdlib/pull/7043) _(by Karan Anand, Philipp Burckhardt)_
508510
- [`23b6d1a`](https://github.com/stdlib-js/stdlib/commit/23b6d1a76ac2fcfed45f24561fe32d59bae722b6) - **feat:** add `math/base/special/modff` [(#7101)](https://github.com/stdlib-js/stdlib/pull/7101) _(by Karan Anand)_
509511
- [`a80a512`](https://github.com/stdlib-js/stdlib/commit/a80a51223274109e524c746abf43727607f2b610) - **docs:** fix argument types _(by Karan Anand)_
510512
- [`d6059e1`](https://github.com/stdlib-js/stdlib/commit/d6059e165da4f439309257fe617c00bde8a7feff) - **docs:** fix function signature _(by Karan Anand)_

base/special/minmaxabsf/README.md

Lines changed: 239 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,239 @@
1+
<!--
2+
3+
@license Apache-2.0
4+
5+
Copyright (c) 2025 The Stdlib Authors.
6+
7+
Licensed under the Apache License, Version 2.0 (the "License");
8+
you may not use this file except in compliance with the License.
9+
You may obtain a copy of the License at
10+
11+
http://www.apache.org/licenses/LICENSE-2.0
12+
13+
Unless required by applicable law or agreed to in writing, software
14+
distributed under the License is distributed on an "AS IS" BASIS,
15+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
See the License for the specific language governing permissions and
17+
limitations under the License.
18+
19+
-->
20+
21+
# minmaxabsf
22+
23+
> Return the minimum and maximum absolute values of two single-precision floating-point numbers.
24+
25+
<!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->
26+
27+
<section class="intro">
28+
29+
</section>
30+
31+
<!-- /.intro -->
32+
33+
<!-- Package usage documentation. -->
34+
35+
<section class="usage">
36+
37+
## Usage
38+
39+
```javascript
40+
var minmaxabsf = require( '@stdlib/math/base/special/minmaxabsf' );
41+
```
42+
43+
#### minmaxabsf( x, y )
44+
45+
Returns the minimum and maximum absolute values of two single-precision floating-point numbers in a single pass.
46+
47+
```javascript
48+
var v = minmaxabsf( 4.2, 3.14 );
49+
// returns [ 3.14, 4.2 ]
50+
51+
v = minmaxabsf( +0.0, -0.0 );
52+
// returns [ 0.0, 0.0 ]
53+
```
54+
55+
If any argument is `NaN`, the function returns `NaN` for both the minimum value and the maximum value.
56+
57+
```javascript
58+
var v = minmaxabsf( 4.2, NaN );
59+
// returns [ NaN, NaN ]
60+
61+
v = minmaxabsf( NaN, 3.14 );
62+
// returns [ NaN, NaN ]
63+
```
64+
65+
#### minmaxabsf.assign( x, y, out, stride, offset )
66+
67+
Returns the minimum and maximum absolute values of two single-precision floating-point numbers in a single pass and assigns results to a provided output array.
68+
69+
```javascript
70+
var Float32Array = require( '@stdlib/array/float32' );
71+
72+
var out = new Float32Array( 2 );
73+
74+
var v = minmaxabsf.assign( 5.0, -2.0, out, 1, 0 );
75+
// returns <Float32Array>[ 2.0, 5.0 ]
76+
77+
var bool = ( v === out );
78+
// returns true
79+
```
80+
81+
</section>
82+
83+
<!-- /.usage -->
84+
85+
<!-- Package usage notes. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
86+
87+
<section class="notes">
88+
89+
</section>
90+
91+
<!-- /.notes -->
92+
93+
<!-- Package usage examples. -->
94+
95+
<section class="examples">
96+
97+
## Examples
98+
99+
<!-- eslint no-undef: "error" -->
100+
101+
```javascript
102+
var logEachMap = require( '@stdlib/console/log-each-map' );
103+
var discreteUniform = require( '@stdlib/random/array/discrete-uniform' );
104+
var minmaxabsf = require( '@stdlib/math/base/special/minmaxabsf' );
105+
106+
var opts = {
107+
'dtype': 'float32'
108+
};
109+
var x = discreteUniform( 100, -100, 100, opts );
110+
var y = discreteUniform( 100, -100, 100, opts );
111+
112+
logEachMap( 'minmaxabsf(%d, %d) = [%s]', x, y, minmaxabsf );
113+
```
114+
115+
</section>
116+
117+
<!-- /.examples -->
118+
119+
<!-- C interface documentation. -->
120+
121+
* * *
122+
123+
<section class="c">
124+
125+
## C APIs
126+
127+
<!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->
128+
129+
<section class="intro">
130+
131+
</section>
132+
133+
<!-- /.intro -->
134+
135+
<!-- C usage documentation. -->
136+
137+
<section class="usage">
138+
139+
### Usage
140+
141+
```c
142+
#include "stdlib/math/base/special/minmaxabsf.h"
143+
```
144+
145+
#### stdlib_base_minmaxabsf( x, y, &min, &max )
146+
147+
Evaluates the minimum and maximum absolute values of two single-precision floating-point numbers in a single pass.
148+
149+
```c
150+
float x = -3.14f;
151+
float y = 2.71f;
152+
153+
float min;
154+
float max;
155+
stdlib_base_minmaxabsf( x, y, &min, &max );
156+
```
157+
158+
The function accepts the following arguments:
159+
160+
- **x**: `[in] float` first number.
161+
- **y**: `[in] float` second number.
162+
- **min**: `[out] float` destination for the minimum absolute value.
163+
- **max**: `[out] float` destination for the maximum absolute value.
164+
165+
```c
166+
void stdlib_base_minmaxabsf( const float x, const float y, float* min, float* max );
167+
```
168+
169+
</section>
170+
171+
<!-- /.usage -->
172+
173+
<!-- C API usage notes. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
174+
175+
<section class="notes">
176+
177+
</section>
178+
179+
<!-- /.notes -->
180+
181+
<!-- C API usage examples. -->
182+
183+
<section class="examples">
184+
185+
### Examples
186+
187+
```c
188+
#include "stdlib/math/base/special/minmaxabsf.h"
189+
#include <stdio.h>
190+
191+
int main( void ) {
192+
const float x[] = { 1.0f, 0.45f, -0.89f, 0.0f / 0.0f, -0.78f, -0.22f, 0.66f, 0.11f, -0.55f, 0.0f };
193+
const float y[] = { -0.22f, 0.66f, 0.0f, -0.55f, 0.33f, 1.0f, 0.0f / 0.0f, 0.11f, 0.45f, -0.78f };
194+
195+
float min;
196+
float max;
197+
int i;
198+
for ( i = 0; i < 10; i++ ) {
199+
stdlib_base_minmaxabsf( x[ i ], y[ i ], &min, &max );
200+
printf( "x: %f, y: %f => min: %f, max: %f\n", x[ i ], y[ i ], min, max );
201+
}
202+
}
203+
```
204+
205+
</section>
206+
207+
<!-- /.examples -->
208+
209+
</section>
210+
211+
<!-- /.c -->
212+
213+
<!-- 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. -->
214+
215+
<section class="references">
216+
217+
</section>
218+
219+
<!-- /.references -->
220+
221+
<!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. -->
222+
223+
<section class="related">
224+
225+
</section>
226+
227+
<!-- /.related -->
228+
229+
<!-- Section for all links. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
230+
231+
<section class="links">
232+
233+
<!-- <related-links> -->
234+
235+
<!-- </related-links> -->
236+
237+
</section>
238+
239+
<!-- /.links -->

0 commit comments

Comments
 (0)