UNPKG

@rayyamhk/complex

Version:

A lightweight and easy-to-use library for you to manipulate complex numbers

25 lines (20 loc) 484 B
"use strict"; /** * Determines whether the Complex Number is NaN or not. * @memberof Complex * @static * @param {Complex} num - Any Complex number * @returns {boolean} Returns true if one of real and imaginary part are NaN */ function isNaN(num) { if (!(num instanceof this)) { return false; } var re = num.getReal(); var im = num.getImaginary(); if (Number.isNaN(re) || Number.isNaN(im)) { return true; } return false; } module.exports = isNaN;