operator unary- method

  1. @override
Cartesian operator unary-()
override

Negate operator. Returns a Complex whose value is -this. Returns NAN if either real or imaginary part of this complex number equals double.nan.

Implementation

@override
Cartesian operator -() {
  if (isNaN) {
    return Complex.nan;
  }

  return Cartesian(-real, -imaginary);
}