complex.js
function() {

      var a = this['re'];
      var b = this['im'];
      var ret = '';

      if (this['isNaN']()) {
        return 'NaN';
      }

      if (this['isZero']()) {
        return '0';
      }

      if (this['isInfinite']()) {
        return 'Infinity';
      }

      if (a !== 0) {
        ret += a;
      }

      if (b !== 0) {

        if (a !== 0) {
          ret += b < 0 ? ' - ' : ' + ';
        } else if (b < 0) {
          ret += '-';
        }

        b = Math.abs(b);

        if (1 !== b) {
          ret += b;
        }
        ret += 'i';
      }

      if (!ret)
        return '0';

      return ret;
    }
function() {

      var a = this['re'];
      var b = this['im'];
      var ret = '';

      if (this['isNaN']()) {
        return 'NaN';
      }

      if (this['isZero']()) {
        return '0';
      }

      if (this['isInfinite']()) {
        return 'Infinity';
      }

      if (a !== 0) {
        ret += a;
      }

      if (b !== 0) {

        if (a !== 0) {
          ret += b < 0 ? ' - ' : ' + ';
        } else if (b < 0) {
          ret += '-';
        }

        b = Math.abs(b);

        if (1 !== b) {
          ret += b;
        }
        ret += 'i';
      }

      if (!ret)
        return '0';

      return ret;
    }
function ( ) { var a = this [ 're' ] ; var b = this [ 'im' ] ; var ret = '' ; if ( this [ 'isNaN' ] ( ) ) { return 'NaN' ; } if ( this [ 'isZero' ] ( ) ) { return '0' ; } if ( this [ 'isInfinite' ] ( ) ) { return 'Infinity' ; } if ( a !== 0 ) { ret += a ; } if ( b !== 0 ) { if ( a !== 0 ) { ret += b < 0 ? ' - ' : ' + ' ; } else if ( b < 0 ) { ret += '-' ; } b = Math . abs ( b ) ; if ( 1 !== b ) { ret += b ; } ret += 'i' ; } if ( ! ret ) return '0' ; return ret ; }
Gets a string of the actual complex number

@returns {string}
Gets a string of the actual complex number