operator == method

  1. @override
bool operator ==(
  1. Object b
)
override

Compare two complex number

Examples

var c1 = Complex(real: 1, imaginary: -3);
var c2 = Complex(real: 1, imaginary: 2);

print(c1 == c2);

/* output:
false
*/

Implementation

@override
bool operator ==(Object b) {
  return b is Complex && b.real == real && b.imaginary == imaginary;
}