anchor.diff:          expect(complex.arg(), 3 * math.pi / 4);
         });
         test('tryParse', () {
  -        expect(Complex.tryParse('1+2i'), Complex(1, 2));
  -        expect(Complex.tryParse('1-2i'), Complex(1, -2));
  -        expect(Complex.tryParse('-1+2i'), Complex(-1, 2));
  -        expect(Complex.tryParse('-1-2i'), Complex(-1, -2));
  +        expect(Complex.tryParse('1+2i'), const Complex(1, 2));
  +        expect(Complex.tryParse('1-2i'), const Complex(1, -2));
  +        expect(Complex.tryParse('-1+2i'), const Complex(-1, 2));
  +        expect(Complex.tryParse('-1-2i'), const Complex(-1, -2));
         });
         test('tryParse (whitespace)', () {
  -        expect(Complex.tryParse('1 + 2i'), Complex(1, 2));
  -        expect(Complex.tryParse('1 - 2i'), Complex(1, -2));
  -        expect(Complex.tryParse(' - 1 + 2 i '), Complex(-1, 2));
  -        expect(Complex.tryParse(' - 1 - 2 i '), Complex(-1, -2));
  +        expect(Complex.tryParse('1 + 2i'), const Complex(1, 2));
  +        expect(Complex.tryParse('1 - 2i'), const Complex(1, -2));
  +        expect(Complex.tryParse(' - 1 + 2 i '), const Complex(-1, 2));
  +        expect(Complex.tryParse(' - 1 - 2 i '), const Complex(-1, -2));
         });
         test('tryParse (permutation)', () {
  -        expect(Complex.tryParse('2i+1'), Complex(1, 2));
  +        expect(Complex.tryParse('2i+1'), const Complex(1, 2));
         });
         test('tryParse (real)', () {
  -        expect(Complex.tryParse('1'), Complex(1));
  -        expect(Complex.tryParse('1.2'), Complex(1.2));
  -        expect(Complex.tryParse('-1.2'), Complex(-1.2));
  -        expect(Complex.tryParse('1.2e2'), Complex(120));
  -        expect(Complex.tryParse('1.2e-2'), Complex(0.012));
  +        expect(Complex.tryParse('1'), const Complex(1));
  +        expect(Complex.tryParse('1.2'), const Complex(1.2));
  +        expect(Complex.tryParse('-1.2'), const Complex(-1.2));
  +        expect(Complex.tryParse('1.2e2'), const Complex(120));
  +        expect(Complex.tryParse('1.2e-2'), const Complex(0.012));
         });
         test('tryParse (imaginary)', () {
  -        expect(Complex.tryParse('i'), Complex(0, 1));
  -        expect(Complex.tryParse('1I'), Complex(0, 1));
  -        expect(Complex.tryParse('1.2i'), Complex(0, 1.2));
  -        expect(Complex.tryParse('-1.2I'), Complex(0, -1.2));
  -        expect(Complex.tryParse('1.2e2i'), Complex(0, 120));
  -        expect(Complex.tryParse('1.2e-2I'), Complex(0, 0.012));
  -        expect(Complex.tryParse('1*i'), Complex(0, 1));
  -        expect(Complex.tryParse('1.2*I'), Complex(0, 1.2));
  -        expect(Complex.tryParse('1.2e2*i'), Complex(0, 120));
  -        expect(Complex.tryParse('1.2e-2*I'), Complex(0, 0.012));
  +        expect(Complex.tryParse('i'), const Complex(0, 1));
  +        expect(Complex.tryParse('1I'), const Complex(0, 1));
  +        expect(Complex.tryParse('1.2i'), const Complex(0, 1.2));
  +        expect(Complex.tryParse('-1.2I'), const Complex(0, -1.2));
  +        expect(Complex.tryParse('1.2e2i'), const Complex(0, 120));
  +        expect(Complex.tryParse('1.2e-2I'), const Complex(0, 0.012));
  +        expect(Complex.tryParse('1*i'), const Complex(0, 1));
  +        expect(Complex.tryParse('1.2*I'), const Complex(0, 1.2));
  +        expect(Complex.tryParse('1.2e2*i'), const Complex(0, 120));
  +        expect(Complex.tryParse('1.2e-2*I'), const Complex(0, 0.012));
         });
         test('tryParse (error)', () {
           expect(Complex.tryParse(''), isNull);
  
positive.code:     });
      group('arithmetic', () {
        test('addition', () {
          expect(Complex(1, -2) + Complex(-3, 4), Complex(-2, 2));
          expect(Complex(1, -2) + 3, Complex(4, -2));
          expect(() => Complex(1, -2) + 'foo', throwsArgumentError);
        });
        test('substraction', () {
          expect(Complex(1, -2) - Complex(-3, 4), Complex(4, -6));
          expect(Complex(1, -2) - 4, Complex(-3, -2));
          expect(() => Complex(1, -2) - 'foo', throwsArgumentError);
        });
        test('multiplication', () {
          expect(Complex(1, -2) * Complex(-3, 4), Complex(5, 10));
          expect(Complex(-3, 4) * Complex(1, -2), Complex(5, 10));
          expect(Complex(-3, 4) * 2, Complex(-6, 8));
          expect(() => Complex(-3, 4) * 'foo', throwsArgumentError);
        });
        test('division', () {
          expect(Complex(5, 10) / Complex(-3, 4), Complex(1, -2));
          expect(Complex(5, 10) / Complex(1, -2), Complex(-3, 4));
          expect(Complex(6, 10) / 2, Complex(3, 5));
          expect(() => Complex(6, 10) / 'foo', throwsArgumentError);
        });
        test('negate', () {
          expect(-Complex(1, -2), Complex(-1, 2));
        });
        test('conjugate', () {
          expect(Complex(1, -2).conjugate(), Complex(1, 2));
        });
        test('reciprocal', () {
          expect(Complex(1, -2).reciprocal(), Complex(0.2, 0.4));
        });
        test('exp', () {
          expect(Complex(1, 2).exp(), isClose(-1.131204, 2.471726));
        });
        test('log', () {
          expect(Complex(1, 2).log(), isClose(0.804718, 1.107148));
        });
        test('pow', () {
          expect(Complex(1, 2).pow(Complex(3, 4)), isClose(0.129009, 0.033924));
        });
        test('square', () {
          expect(Complex(2, 3).square(), Complex(-5, 12));
          expect(Complex(-2, 3).square(), Complex(-5, -12));
          expect(Complex(2, -3).square(), Complex(-5, -12));
          expect(Complex(-2, -3).square(), Complex(-5, 12));
        });
        test('sqrt', () {
          expect(Complex(2, 3).sqrt(), isClose(1.674149, 0.895977));
          expect(Complex(-2, 3).sqrt(), isClose(0.895977, 1.674149));
          expect(Complex(2, -3).sqrt(), isClose(1.674149, -0.895977));
          expect(Complex(-2, -3).sqrt(), isClose(0.895977, -1.674149));
          expect(Complex(2, 3).sqrt().square(), isClose(2, 3));
        });
        group('roots', () {
          final source = Complex(2, 3);
          void testRoots(int n) {
            test('$source.roots($n)', () {
              final roots = source.roots(n);
  
negative.code:         expect(Quaternion.i.toString(), 'Quaternion(0, 1, 0, 0)');
          expect(Quaternion.j.toString(), 'Quaternion(0, 0, 1, 0)');
          expect(Quaternion.k.toString(), 'Quaternion(0, 0, 0, 1)');
          expect(
              const Quaternion(0, 2, 4, 6).toString(), 'Quaternion(0, 2, 4, 6)');
          expect(const Quaternion(1, -1, 2, -3).toString(),
              'Quaternion(1, -1, 2, -3)');
        });
      });
      group('comparing', () {
        test('equal', () {
          expect(const Quaternion(2, 3, 4, 5) == const Quaternion(2, 3, 4, 5),
              isTrue);
          expect(const Quaternion(2, 3, 4, 5) == const Quaternion(1, 3, 4, 5),
              isFalse);
          expect(const Quaternion(2, 3, 4, 5) == const Quaternion(2, 4, 4, 5),
              isFalse);
          expect(const Quaternion(2, 3, 4, 5) == const Quaternion(2, 3, 3, 5),
              isFalse);
          expect(const Quaternion(2, 3, 4, 5) == const Quaternion(2, 3, 4, 6),
              isFalse);
        });
        test('hash', () {
          expect(const Quaternion(2, 3, 4, 5).hashCode,
              const Quaternion(2, 3, 4, 5).hashCode);
          expect(const Quaternion(2, 3, 4, 5).hashCode,
              isNot(const Quaternion(3, 2, 4, 5).hashCode));
          expect(const Quaternion(2, 3, 4, 5).hashCode,
              isNot(const Quaternion(2, 4, 3, 5).hashCode));
          expect(const Quaternion(2, 3, 4, 5).hashCode,
              isNot(const Quaternion(2, 3, 5, 4).hashCode));
        });
      });
    });
  