Skip to content

Commit

Permalink
Auto-generated commit
Browse files Browse the repository at this point in the history
  • Loading branch information
stdlib-bot committed Sep 6, 2024
1 parent a0ca96f commit 15be406
Show file tree
Hide file tree
Showing 9 changed files with 37 additions and 32 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,7 @@ A total of 4 people contributed to this release. Thank you to the following cont

<details>

- [`7edbd56`](https://github.com/stdlib-js/stdlib/commit/7edbd56db6a1dc6aa955a47be48120c410e1c6af) - **docs:** update examples [(#2873)](https://github.com/stdlib-js/stdlib/pull/2873) _(by Gunj Joshi, Athan Reines)_
- [`b7e79ad`](https://github.com/stdlib-js/stdlib/commit/b7e79ad951c4e439ca972dc57dd88de9e38f814c) - **docs:** update function descriptions and fix style nits [(#2870)](https://github.com/stdlib-js/stdlib/pull/2870) _(by Gunj Joshi)_
- [`a294334`](https://github.com/stdlib-js/stdlib/commit/a294334209d981a41f61bda8fd222e1c555f0c5a) - **style:** fix spacing [(#2872)](https://github.com/stdlib-js/stdlib/pull/2872) _(by Gunj Joshi)_
- [`1f5dba3`](https://github.com/stdlib-js/stdlib/commit/1f5dba3820e6cc2283b593ec2bf4942404ddd3d2) - **style:** remove empty line [(#2869)](https://github.com/stdlib-js/stdlib/pull/2869) _(by Gunj Joshi)_
Expand Down
24 changes: 13 additions & 11 deletions base/special/minabsf/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ var minabsf = require( '@stdlib/math/base/special/minabsf' );
Returns the minimum absolute single-precision floating-point number.

```javascript
var v = minabsf( -4.2, 3.14 );
// returns ~3.14
var v = minabsf( -4.0, 3.0 );
// returns 3.0

v = minabsf( +0.0, -0.0 );
// returns +0.0
Expand Down Expand Up @@ -83,19 +83,21 @@ v = minabsf( NaN, 3.14 );
<!-- eslint no-undef: "error" -->

```javascript
var randu = require( '@stdlib/random/base/randu' );
var randu = require( '@stdlib/random/array/uniform' );
var minabsf = require( '@stdlib/math/base/special/minabsf' );

var x;
var y;
var opts = {
'dtype': 'float32'
};

var x = randu( 100, -500.0, 500.0, opts );
var y = randu( 100, -500.0, 500.0, opts );

var v;
var i;

for ( i = 0; i < 100; i++ ) {
x = ( randu() * 1000.0 ) - 500.0;
y = ( randu() * 1000.0 ) - 500.0;
v = minabsf( x, y );
console.log( 'minabsf(%d,%d) = %d', x, y, v );
v = minabsf( x[ i ], y[ i ] );
console.log( 'minabsf(%d,%d) = %d', x[ i ], y[ i ], v );
}
```

Expand Down Expand Up @@ -178,7 +180,7 @@ int main( void ) {
float y;
float v;
int i;
for ( i = 0; i < 100; i++ ) {
x = ( ( (float)rand() / (float)RAND_MAX ) * 1000.0f ) - 500.0f;
y = ( ( (float)rand() / (float)RAND_MAX ) * 1000.0f ) - 500.0f;
Expand Down
8 changes: 4 additions & 4 deletions base/special/minabsf/docs/repl.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

{{alias}}( x, y )
Returns the minimum absolute absolute single-precision
floating-point number.
Returns the minimum absolute single-precision floating-point
number.

If any argument is `NaN`, the function returns `NaN`.

Expand All @@ -20,8 +20,8 @@

Examples
--------
> var v = {{alias}}( 3.14, -4.2 )
~3.14
> var v = {{alias}}( -4.0, 3.0 )
3.0
> v = {{alias}}( 3.14, NaN )
NaN
> v = {{alias}}( +0.0, -0.0 )
Expand Down
4 changes: 2 additions & 2 deletions base/special/minabsf/docs/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
* @returns minimum absolute value
*
* @example
* var v = minabsf( -3.14, 4.2 );
* // returns ~3.14
* var v = minabsf( -4.0, 3.0 );
* // returns 3.0
*
* @example
* var v = minabsf( 3.14, NaN );
Expand Down
18 changes: 10 additions & 8 deletions base/special/minabsf/examples/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,19 @@

'use strict';

var randu = require( '@stdlib/random/base/randu' );
var randu = require( '@stdlib/random/array/uniform' );
var minabsf = require( './../lib' );

var x;
var y;
var opts = {
'dtype': 'float32'
};

var x = randu( 100, -500.0, 500.0, opts );
var y = randu( 100, -500.0, 500.0, opts );

var v;
var i;

for ( i = 0; i < 100; i++ ) {
x = ( randu() * 1000.0 ) - 500.0;
y = ( randu() * 1000.0 ) - 500.0;
v = minabsf( x, y );
console.log( 'minabsf(%d,%d) = %d', x, y, v );
v = minabsf( x[ i ], y[ i ] );
console.log( 'minabsf(%d,%d) = %d', x[ i ], y[ i ], v );
}
4 changes: 2 additions & 2 deletions base/special/minabsf/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
* @example
* var minabsf = require( '@stdlib/math/base/special/minabsf' );
*
* var v = minabsf( -3.14, 4.2 );
* // returns ~3.14
* var v = minabsf( -4.0, 3.0 );
* // returns 3.0
*
* v = min( 3.14, NaN );
* // returns NaN
Expand Down
4 changes: 2 additions & 2 deletions base/special/minabsf/lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ var float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );
* @returns {number} minimum absolute value
*
* @example
* var v = minabsf( -3.14, 4.2 );
* // returns ~3.14
* var v = minabsf( -4.0, 3.0 );
* // returns 3.0
*
* @example
* var v = minabsf( 3.14, NaN );
Expand Down
4 changes: 2 additions & 2 deletions base/special/minabsf/lib/native.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ var addon = require( './../src/addon.node' );
* @returns {number} minimum absolute value
*
* @example
* var v = minabsf( -4.2, 3.14 );
* // returns ~3.14
* var v = minabsf( -4.0, 3.0 );
* // returns 3.0
*
* @example
* var v = minabsf( 0.0, -0.0 );
Expand Down
2 changes: 1 addition & 1 deletion base/special/minabsf/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
*
* @example
* float v = stdlib_base_minabsf( 3.14f, -4.2f );
* // returns ~3.14f
* // returns 3.14f
*
* @example
* float v = stdlib_base_minabsf( 0.0f, -0.0f );
Expand Down

0 comments on commit 15be406

Please sign in to comment.