UNPKG

538 BJavaScriptView Raw
1"use strict";
2
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6exports.complexEquals = complexEquals;
7
8var _number = require("./number.js");
9
10/**
11 * Test whether two complex values are equal provided a given epsilon.
12 * Does not use or change the global Complex.EPSILON setting
13 * @param {Complex} x
14 * @param {Complex} y
15 * @param {number} epsilon
16 * @returns {boolean}
17 */
18function complexEquals(x, y, epsilon) {
19 return (0, _number.nearlyEqual)(x.re, y.re, epsilon) && (0, _number.nearlyEqual)(x.im, y.im, epsilon);
20}
\No newline at end of file