UNPKG

404 BJavaScriptView Raw
1import { nearlyEqual } from './number.js';
2/**
3 * Test whether two complex values are equal provided a given epsilon.
4 * Does not use or change the global Complex.EPSILON setting
5 * @param {Complex} x
6 * @param {Complex} y
7 * @param {number} epsilon
8 * @returns {boolean}
9 */
10
11export function complexEquals(x, y, epsilon) {
12 return nearlyEqual(x.re, y.re, epsilon) && nearlyEqual(x.im, y.im, epsilon);
13}
\No newline at end of file