main
Last change
on this file since 79a0317 was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 3 days ago |
F4 Finalna Verzija
|
-
Property mode
set to
100644
|
File size:
569 bytes
|
Rev | Line | |
---|
[d565449] | 1 | 'use strict';
|
---|
| 2 |
|
---|
[79a0317] | 3 | var isNegativeZero = require('math-intrinsics/isNegativeZero');
|
---|
[d565449] | 4 | var $TypeError = require('es-errors/type');
|
---|
| 5 |
|
---|
| 6 | var NumberSameValueZero = require('./sameValueZero');
|
---|
| 7 |
|
---|
| 8 | // https://262.ecma-international.org/11.0/#sec-numeric-types-number-sameValue
|
---|
| 9 |
|
---|
| 10 | module.exports = function NumberSameValue(x, y) {
|
---|
| 11 | if (typeof x !== 'number' || typeof y !== 'number') {
|
---|
| 12 | throw new $TypeError('Assertion failed: `x` and `y` arguments must be Numbers');
|
---|
| 13 | }
|
---|
| 14 | if (x === 0 && y === 0) {
|
---|
| 15 | return !(isNegativeZero(x) ^ isNegativeZero(y));
|
---|
| 16 | }
|
---|
| 17 | return NumberSameValueZero(x, y);
|
---|
| 18 | };
|
---|
Note:
See
TracBrowser
for help on using the repository browser.