Compare two complex numbers, `x` and `y`:

- First, compare the real values of `x` and `y`
- If equal, compare the imaginary values of `x` and `y`

@params {Complex} x
@params {Complex} y
@returns {number} Returns the comparison result: -1, 0, or 1
505455
function compareComplexNumbers (x, y) {
  if (x.re > y.re) { return 1 }
  if (x.re < y.re) { return -1 }

  if (x.im > y.im) { return 1 }
  if (x.im < y.im) { return -1 }

  return 0
}
917367
function is(x, y) {
  let ret = false;
  // SameValue algorithm
  if (x === y) { // Steps 1-5, 7-10
    // Steps 6.b-6.e: +0 != -0
    ret = (x !== 0 || 1 / x === 1 / y);
  } else {
    // Step 6.a: NaN == NaN
    ret = (x !== x && y !== y);
  }

  return ret;
}
164658
function isIdenticalTo( x , y ) {
	return x === y || ( Number.isNaN( x ) && Number.isNaN( y ) ) ;
}
306965
private static Number impl_(Number x, Number y) {
        return (x.doubleValue() > y.doubleValue() ? y : x);
    }
1369642
function equals(a, b) {
  var a0 = a[0]
  var a1 = a[1]
  var a2 = a[2]
  var b0 = b[0]
  var b1 = b[1]
  var b2 = b[2]
  return (Math.abs(a0 - b0) <= EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&
          Math.abs(a1 - b1) <= EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&
          Math.abs(a2 - b2) <= EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)))
}
1216660
function ( a, b ) {
		var types = {a: typeof a, b: typeof b},
		    c, d, result;

		if ( types.a === "number" && types.b === "number" ) {
			result = a - b;
		}
		else {
			c = a.toString();
			d = b.toString();

			if ( c < d ) {
				result = -1;
			}
			else if ( c > d ) {
				result = 1;
			}
			else if ( types.a === types.b ) {
				result = 0;
			}
			else if ( types.a === "boolean" ) {
				result = -1;
			}
			else {
				result = 1;
			}
		}

		return result;
	}
298931
function (a, b) {
            if (!b.pos || !a.pos) {
                return (a.pos ? -Infinity : Infinity);
            }
            var result = b.pos.z - a.pos.z;
            return (result ? result : (b.pos.x - a.pos.x));
        }
1281907
public static boolean same(Object x, Object y) {
        if (!typeof(x).equals(typeof(y))) {
            return false;
        }
        if (x instanceof Number) {
            if (isNaN(x) && isNaN(y)) {
                return true;
            }
            return x.equals(y);
        }
        return eq(x, y);
    }
626485
function (n1, n2) {
            var isOk1 = _isNumber(n1),
                isOk2 = _isNumber(n2);
            
            if (isOk1 && isOk2) {
                // both are finite numbers
                return (n1 - n2);
            }
            else if (isOk1)
                return -1;
            else if (isOk2)
                return 1;
            else
                return 0;
        }
631177
function(n) {
    n = _.isInteger(n) ? n : 0

    return {
      x: n,
      y: n,
      data: _.map(_.range(n), function (num) {
        return [num]
      })
    }
  }
725222
public static BigComplex valueOf(double real, double imaginary) {
		return valueOf(BigDecimal.valueOf(real), BigDecimal.valueOf(imaginary));
	}
504602
function isSameRef(x, y) {
  if (x === y) {
    return x !== 0 || y !== 0 || 1 / x === 1 / y
  } else {
    return x !== x && y !== y
  }
}
1176487
function equals(a, b) {
  var a0 = a[0]
  var a1 = a[1]
  var b0 = b[0]
  var b1 = b[1]
  return (Math.abs(a0 - b0) <= EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&
          Math.abs(a1 - b1) <= EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)))
}
703627
public static boolean equalsIncludingNaN(double x, double y) {
        return (Double.isNaN(x) && Double.isNaN(y)) || equals(x, y, 1);
    }
1122574
public static int compareUnsigned(int x, int y) {
    return Integer.compare(x + Integer.MIN_VALUE, y + Integer.MIN_VALUE);
  }
271452
function() {

      // acsch(c) = log((1+sqrt(1+c^2))/c)

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

      if (b === 0) {

        return new Complex(
                (a !== 0)
                ? Math.log(a + Math.sqrt(a * a + 1))
                : Infinity, 0);
      }

      var d = a * a + b * b;
      return (d !== 0)
              ? new Complex(
                      a / d,
                      -b / d).asinh()
              : new Complex(
                      (a !== 0) ? a / 0 : 0,
                      (b !== 0) ? -b / 0 : 0).asinh();
    }
687014
public static boolean equals2(Object x, Object y) {
        if (x instanceof java.lang.Number)
            return equalsNumObject((java.lang.Number)x, y);
        if (x instanceof java.lang.Character)
            return equalsCharObject((java.lang.Character)x, y);
        if (x == null)
            return y == null;

        return x.equals(y);
    }