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 Jun 12, 2024
1 parent 1abe8dd commit 9201682
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 14 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<section class="release" id="unreleased">

## Unreleased (2024-06-10)
## Unreleased (2024-06-12)

<section class="features">

Expand All @@ -22,6 +22,7 @@

<details>

- [`29fbbb6`](https://github.com/stdlib-js/stdlib/commit/29fbbb62d94cb2af1d8856004b75c03daf942053) - **chore:** minor clean-up _(by Philipp Burckhardt)_
- [`a985cc2`](https://github.com/stdlib-js/stdlib/commit/a985cc224aa74759783c5c4d9577769a36ed818f) - **feat:** add `math/base/special/nanmin` _(by Ridam Garg, RidamGarg, stdlib-bot, Philipp Burckhardt)_

</details>
Expand Down
21 changes: 17 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,11 @@ v = nanmin( NaN, 3.14 );
// returns 3.14
```


If both argument are `NaN`, the function returns `NaN`.
If both arguments are `NaN`, the function returns `NaN`.

```javascript
var v = nanmin( NaN, NaN );
// returns NaN

```

</section>
Expand All @@ -114,6 +112,17 @@ var v = nanmin( NaN, NaN );

</section>

<!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. -->

<section class="related">

</section>

<!-- /.related -->

<!-- Section for all links. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->


<section class="main-repo" >

* * *
Expand Down Expand Up @@ -183,6 +192,10 @@ Copyright &copy; 2016-2024. The Stdlib [Authors][stdlib-authors].

[stdlib-license]: https://raw.githubusercontent.com/stdlib-js/math-base-special-nanmin/main/LICENSE

<!-- <related-links> -->

<!-- </related-links> -->

</section>

<!-- /.links -->
<!-- /.links -->
4 changes: 2 additions & 2 deletions dist/index.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 8 additions & 6 deletions examples/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,17 @@
var nanmin = require( './../lib' );

var m = nanmin( 3.0, 4.0 );
// returns 3.0
console.log( m );
// => 3.0

m = nanmin( NaN, 4.0 );
// returns 4.0
console.log( m );
// => 4.0

m = nanmin( 4.0, NaN );
// returns 4.0
console.log( m );
// => 4.0

m = nanmin( NaN, NaN );
// returns NaN

console.log(m);
console.log( m );
// => NaN
2 changes: 1 addition & 1 deletion lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ var isnan = require( '@stdlib/math-base-assert-is-nan');
*/
function nanmin( x, y ) {
if ( isnan( x ) ) {
return ( isnan(y) ) ? NaN : y;
return ( isnan( y ) ) ? NaN : y;
}
return ( isnan( y ) ) ? x : min( x, y );
}
Expand Down

0 comments on commit 9201682

Please sign in to comment.