public static long pythagoras(long x, long y)
			throws FixedPointLongException {
		int bitShift = (bitsUsed(x) + bitsUsed(y) + 1 - LENGTH) / 2;
		if (bitShift < 0)
			bitShift = 0;
		// System.err.println("bitsUsed(x) = " + bitsUsed(x) + " bitsUsed(y) = "
		// + bitsUsed(y) + " bitShift is " + bitShift);

		x >>= bitShift;
		y >>= bitShift;

		/* commented out to remove warning */
		// long sumsquares = square(x) + square(y);
		long ret = sqrt(square(x) + square(y)) << bitShift;
		// System.err.println("pythag of " + flongToString(xtemp) + " (bu " +
		// bitsUsed(xtemp) + ") and " + flongToString(ytemp) + " (bu " +
		// bitsUsed(ytemp) + ") is " + flongToString(ret) + " (bitShift " +
		// bitShift + ")");
		return ret;
	}