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 Feb 1, 2024
1 parent d8c57d2 commit 29c33d4
Show file tree
Hide file tree
Showing 6 changed files with 168 additions and 20 deletions.
1 change: 1 addition & 0 deletions .github/.keepalive
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2024-02-01T01:58:37.559Z
22 changes: 10 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,14 @@ npm install @stdlib/number-float64-base-assert-is-same-value-zero

Alternatively,

- To load the package in a website via a `script` tag without installation and bundlers, use the [ES Module][es-module] available on the [`esm` branch][esm-url].
- If you are using Deno, visit the [`deno` branch][deno-url].
- For use in Observable, or in browser/node environments, use the [Universal Module Definition (UMD)][umd] build available on the [`umd` branch][umd-url].
- To load the package in a website via a `script` tag without installation and bundlers, use the [ES Module][es-module] available on the [`esm`][esm-url] branch (see [README][esm-readme]).
- If you are using Deno, visit the [`deno`][deno-url] branch (see [README][deno-readme] for usage intructions).
- For use in Observable, or in browser/node environments, use the [Universal Module Definition (UMD)][umd] build available on the [`umd`][umd-url] branch (see [README][umd-readme]).

The [branches.md][branches-url] file summarizes the available branches and displays a diagram illustrating their relationships.

To view installation and usage instructions specific to each branch build, be sure to explicitly navigate to the respective README files on each branch, as linked to above.

</section>

<section class="usage">
Expand Down Expand Up @@ -266,11 +268,6 @@ For more information on the project, filing bug reports and feature requests, an

---

## License

See [LICENSE][stdlib-license].


## Copyright

Copyright &copy; 2016-2024. The Stdlib [Authors][stdlib-authors].
Expand All @@ -286,8 +283,8 @@ Copyright &copy; 2016-2024. The Stdlib [Authors][stdlib-authors].
[npm-image]: http://img.shields.io/npm/v/@stdlib/number-float64-base-assert-is-same-value-zero.svg
[npm-url]: https://npmjs.org/package/@stdlib/number-float64-base-assert-is-same-value-zero

[test-image]: https://github.com/stdlib-js/number-float64-base-assert-is-same-value-zero/actions/workflows/test.yml/badge.svg?branch=v0.1.0
[test-url]: https://github.com/stdlib-js/number-float64-base-assert-is-same-value-zero/actions/workflows/test.yml?query=branch:v0.1.0
[test-image]: https://github.com/stdlib-js/number-float64-base-assert-is-same-value-zero/actions/workflows/test.yml/badge.svg?branch=main
[test-url]: https://github.com/stdlib-js/number-float64-base-assert-is-same-value-zero/actions/workflows/test.yml?query=branch:main

[coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/number-float64-base-assert-is-same-value-zero/main.svg
[coverage-url]: https://codecov.io/github/stdlib-js/number-float64-base-assert-is-same-value-zero?branch=main
Expand All @@ -310,12 +307,13 @@ Copyright &copy; 2016-2024. The Stdlib [Authors][stdlib-authors].
[es-module]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules

[deno-url]: https://github.com/stdlib-js/number-float64-base-assert-is-same-value-zero/tree/deno
[deno-readme]: https://github.com/stdlib-js/number-float64-base-assert-is-same-value-zero/blob/deno/README.md
[umd-url]: https://github.com/stdlib-js/number-float64-base-assert-is-same-value-zero/tree/umd
[umd-readme]: https://github.com/stdlib-js/number-float64-base-assert-is-same-value-zero/blob/umd/README.md
[esm-url]: https://github.com/stdlib-js/number-float64-base-assert-is-same-value-zero/tree/esm
[esm-readme]: https://github.com/stdlib-js/number-float64-base-assert-is-same-value-zero/blob/esm/README.md
[branches-url]: https://github.com/stdlib-js/number-float64-base-assert-is-same-value-zero/blob/main/branches.md

[stdlib-license]: https://raw.githubusercontent.com/stdlib-js/number-float64-base-assert-is-same-value-zero/main/LICENSE

[@stdlib/number/float64/base/assert/is-same-value]: https://github.com/stdlib-js/number-float64-base-assert-is-same-value

</section>
Expand Down
11 changes: 7 additions & 4 deletions branches.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ This repository has the following branches:

- **main**: default branch generated from the [stdlib project][stdlib-url], where all development takes place.
- **production**: [production build][production-url] of the package (e.g., reformatted error messages to reduce bundle sizes and thus the number of bytes transmitted over a network).
- **esm**: [ES Module][esm-url] branch for use via a `script` tag without the need for installation and bundlers.
- **deno**: [Deno][deno-url] branch for use in Deno.
- **umd**: [UMD][umd-url] branch for use in Observable, or in dual browser/Node.js environments.
- **esm**: [ES Module][esm-url] branch for use via a `script` tag without the need for installation and bundlers (see [README][esm-readme]).
- **deno**: [Deno][deno-url] branch for use in Deno (see [README][deno-readme]).
- **umd**: [UMD][umd-url] branch for use in Observable, or in dual browser/Node.js environments (see [README][umd-readme]).

The following diagram illustrates the relationships among the above branches:

Expand All @@ -49,5 +49,8 @@ C -->|bundle| F[umd];
[stdlib-url]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/number/float64/base/assert/is-same-value-zero
[production-url]: https://github.com/stdlib-js/number-float64-base-assert-is-same-value-zero/tree/production
[deno-url]: https://github.com/stdlib-js/number-float64-base-assert-is-same-value-zero/tree/deno
[deno-readme]: https://github.com/stdlib-js/number-float64-base-assert-is-same-value-zero/blob/deno/README.md
[umd-url]: https://github.com/stdlib-js/number-float64-base-assert-is-same-value-zero/tree/umd
[esm-url]: https://github.com/stdlib-js/number-float64-base-assert-is-same-value-zero/tree/esm
[umd-readme]: https://github.com/stdlib-js/number-float64-base-assert-is-same-value-zero/blob/umd/README.md
[esm-url]: https://github.com/stdlib-js/number-float64-base-assert-is-same-value-zero/tree/esm
[esm-readme]: https://github.com/stdlib-js/number-float64-base-assert-is-same-value-zero/blob/esm/README.md
36 changes: 32 additions & 4 deletions dist/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,33 @@
"use strict";var i=function(r,e){return function(){return e||r((e={exports:{}}).exports,e),e.exports}};var s=i(function(c,t){
function u(r,e){return r===e||r!==r&&e!==e}t.exports=u
});var n=s();module.exports=n;
/** @license Apache-2.0 */
//# sourceMappingURL=index.js.map

'use strict';

/**
* Test if two double-precision floating-point numbers are the same value.
*
* @module @stdlib/number-float64-base-assert-is-same-value-zero
*
* @example
* var isSameValueZero = require( '@stdlib/number-float64-base-assert-is-same-value-zero' );
*
* var bool = isSameValueZero( 3.14, 3.14 );
* // returns true
*
* bool = isSameValueZero( -0.0, -0.0 );
* // returns true
*
* bool = isSameValueZero( -0.0, 0.0 );
* // returns true
*
* bool = isSameValueZero( NaN, NaN );
* // returns true
*/

// MODULES //

var main = require( './main.js' );


// EXPORTS //

module.exports = main;
58 changes: 58 additions & 0 deletions dist/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/**
* @license Apache-2.0
*
* Copyright (c) 2024 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

'use strict';

// MAIN //

/**
* Tests if two double-precision floating-point numbers are the same value.
*
* ## Notes
*
* - The function implements the SameValueZero Algorithm used by `TypedArray` and `ArrayBuffer` constructors, `Map` and `Set` operations, `String.prototype.includes`, and `Array.prototype.includes` since ES2016.
* - In contrast to the strict equality operator `===`, `NaNs` are considered the same value.
*
* @param {number} a - first input value
* @param {number} b - second input value
* @returns {boolean} boolean indicating whether two double-precision floating-point numbers are the same value
*
* @example
* var bool = isSameValueZero( 3.14, 3.14 );
* // returns true
*
* @example
* var bool = isSameValueZero( -0.0, -0.0 );
* // returns true
*
* @example
* var bool = isSameValueZero( -0.0, 0.0 );
* // returns true
*
* @example
* var bool = isSameValueZero( NaN, NaN );
* // returns true
*/
function isSameValueZero( a, b ) {
return ( a === b ) || ( a !== a && b !== b ); // handles NaNs
}


// EXPORTS //

module.exports = isSameValueZero;
60 changes: 60 additions & 0 deletions dist/native.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/**
* @license Apache-2.0
*
* Copyright (c) 2024 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

'use strict';

// MODULES //

var Boolean = require( '@stdlib/boolean-ctor' );
var addon = require( './../src/addon.node' );


// MAIN //

/**
* Tests if two double-precision floating-point numbers are the same value.
*
* @private
* @param {number} a - first input value
* @param {number} b - second input value
* @returns {boolean} boolean indicating whether two double-precision floating-point numbers are the same value
*
* @example
* var bool = isSameValueZero( 3.14, 3.14 );
* // returns true
*
* @example
* var bool = isSameValueZero( -0.0, -0.0 );
* // returns true
*
* @example
* var bool = isSameValueZero( -0.0, 0.0 );
* // returns true
*
* @example
* var bool = isSameValueZero( NaN, NaN );
* // returns true
*/
function isSameValueZero( a, b ) {
return Boolean( addon( a, b ) );
}


// EXPORTS //

module.exports = isSameValueZero;

0 comments on commit 29c33d4

Please sign in to comment.