complex.js
function(a, b) {

      var z = new Complex(a, b);

      // Infinity + Infinity = NaN
      if (this['isInfinite']() && z['isInfinite']()) {
        return Complex['NAN'];
      }

      // Infinity + z = Infinity { where z != Infinity }
      if (this['isInfinite']() || z['isInfinite']()) {
        return Complex['INFINITY'];
      }

      return new Complex(
              this['re'] + z['re'],
              this['im'] + z['im']);
    }
function(a, b) {

      var z = new Complex(a, b);

      // Infinity + Infinity = NaN
      if (this['isInfinite']() && z['isInfinite']()) {
        return Complex['NAN'];
      }

      // Infinity + z = Infinity { where z != Infinity }
      if (this['isInfinite']() || z['isInfinite']()) {
        return Complex['INFINITY'];
      }

      return new Complex(
              this['re'] + z['re'],
              this['im'] + z['im']);
    }
function ( a , b ) { var z = new Complex ( a , b ) ; // Infinity + Infinity = NaN if ( this [ 'isInfinite' ] ( ) && z [ 'isInfinite' ] ( ) ) { return Complex [ 'NAN' ] ; } // Infinity + z = Infinity { where z != Infinity } if ( this [ 'isInfinite' ] ( ) || z [ 'isInfinite' ] ( ) ) { return Complex [ 'INFINITY' ] ; } return new Complex ( this [ 're' ] + z [ 're' ] , this [ 'im' ] + z [ 'im' ] ) ; }
Adds two complex numbers

@returns {Complex}
Adds two complex numbers