From 92016825e00b632bb01dbc951db1e8a207049dce Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Wed, 12 Jun 2024 02:33:27 +0000 Subject: [PATCH] Auto-generated commit --- CHANGELOG.md | 3 ++- README.md | 21 +++++++++++++++++---- dist/index.js.map | 4 ++-- examples/index.js | 14 ++++++++------ lib/main.js | 2 +- 5 files changed, 30 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 21a135f..fb0e08a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@
-## Unreleased (2024-06-10) +## Unreleased (2024-06-12)
@@ -22,6 +22,7 @@
+- [`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)_
diff --git a/README.md b/README.md index 1887780..beacb57 100644 --- a/README.md +++ b/README.md @@ -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 - ```
@@ -114,6 +112,17 @@ var v = nanmin( NaN, NaN );
+ + + + + + + + +
* * * @@ -183,6 +192,10 @@ Copyright © 2016-2024. The Stdlib [Authors][stdlib-authors]. [stdlib-license]: https://raw.githubusercontent.com/stdlib-js/math-base-special-nanmin/main/LICENSE + + + +
- \ No newline at end of file + diff --git a/dist/index.js.map b/dist/index.js.map index cece968..4857182 100644 --- a/dist/index.js.map +++ b/dist/index.js.map @@ -1,7 +1,7 @@ { "version": 3, "sources": ["../lib/main.js", "../lib/index.js"], - "sourcesContent": ["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar min = require( '@stdlib/math-base-special-min');\nvar isnan = require( '@stdlib/math-base-assert-is-nan');\n\n\n// MAIN //\n\n/**\n* Return the minimum value, ignoring NaN.\n*\n* @param {number} x - first number\n* @param {number} y - second number\n* @returns {number} minimum value\n*\n* @example\n* var v = nanmin( 3.14, 4.2 );\n* // returns 3.14\n*\n* @example\n* var v = nanmin( 4.14, NaN );\n* // returns 4.14\n*\n* @example\n* var v = nanmin( NaN, NaN);\n* // returns NaN\n*/\nfunction nanmin( x, y ) {\n\tif ( isnan( x ) ) {\n\t\treturn ( isnan(y) ) ? NaN : y;\n\t}\n\treturn ( isnan( y ) ) ? x : min( x, y );\n}\n\n\n// EXPORTS //\n\nmodule.exports = nanmin;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return the minimum value, ignoring NaN.\n*\n* @module @stdlib/math-base-special-nanmin\n*\n* @example\n* var nanmin = require( '@stdlib/math-base-special-nanmin' );\n*\n* var v = nanmin( 3.14, 4.2 );\n* // returns 3.14\n*\n* v = nanmin( 4.14, NaN );\n* // returns 4.14\n*\n* v = nanmin( NaN, NaN );\n* // returns NaN\n*/\n\n// MODULES //\n\nvar nanmin = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = nanmin;\n"], - "mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAM,QAAS,+BAA+B,EAC9CC,EAAQ,QAAS,iCAAiC,EAwBtD,SAASC,EAAQC,EAAGC,EAAI,CACvB,OAAKH,EAAOE,CAAE,EACJF,EAAMG,CAAC,EAAM,IAAMA,EAEpBH,EAAOG,CAAE,EAAMD,EAAIH,EAAKG,EAAGC,CAAE,CACvC,CAKAL,EAAO,QAAUG,ICjBjB,IAAIG,EAAS,IAKb,OAAO,QAAUA", + "sourcesContent": ["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar min = require( '@stdlib/math-base-special-min');\nvar isnan = require( '@stdlib/math-base-assert-is-nan');\n\n\n// MAIN //\n\n/**\n* Return the minimum value, ignoring NaN.\n*\n* @param {number} x - first number\n* @param {number} y - second number\n* @returns {number} minimum value\n*\n* @example\n* var v = nanmin( 3.14, 4.2 );\n* // returns 3.14\n*\n* @example\n* var v = nanmin( 4.14, NaN );\n* // returns 4.14\n*\n* @example\n* var v = nanmin( NaN, NaN);\n* // returns NaN\n*/\nfunction nanmin( x, y ) {\n\tif ( isnan( x ) ) {\n\t\treturn ( isnan( y ) ) ? NaN : y;\n\t}\n\treturn ( isnan( y ) ) ? x : min( x, y );\n}\n\n\n// EXPORTS //\n\nmodule.exports = nanmin;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return the minimum value, ignoring NaN.\n*\n* @module @stdlib/math-base-special-nanmin\n*\n* @example\n* var nanmin = require( '@stdlib/math-base-special-nanmin' );\n*\n* var v = nanmin( 3.14, 4.2 );\n* // returns 3.14\n*\n* v = nanmin( 4.14, NaN );\n* // returns 4.14\n*\n* v = nanmin( NaN, NaN );\n* // returns NaN\n*/\n\n// MODULES //\n\nvar nanmin = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = nanmin;\n"], + "mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAM,QAAS,+BAA+B,EAC9CC,EAAQ,QAAS,iCAAiC,EAwBtD,SAASC,EAAQC,EAAGC,EAAI,CACvB,OAAKH,EAAOE,CAAE,EACJF,EAAOG,CAAE,EAAM,IAAMA,EAEtBH,EAAOG,CAAE,EAAMD,EAAIH,EAAKG,EAAGC,CAAE,CACvC,CAKAL,EAAO,QAAUG,ICjBjB,IAAIG,EAAS,IAKb,OAAO,QAAUA", "names": ["require_main", "__commonJSMin", "exports", "module", "min", "isnan", "nanmin", "x", "y", "nanmin"] } diff --git a/examples/index.js b/examples/index.js index 2d8bb2b..54403cb 100644 --- a/examples/index.js +++ b/examples/index.js @@ -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 diff --git a/lib/main.js b/lib/main.js index ea44e34..78e8f9b 100644 --- a/lib/main.js +++ b/lib/main.js @@ -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 ); }