public static long sqrt(long flong) throws FixedPointLongException {
		if (flong < 0)
			throw new FixedPointLongException(
					"FixedPointLong: sqrt of -ve number!: "
							+ FixedPointLong.flongToString(flong));
		if (flong == 0)
			return 0;
		long oldans = 0;
		long ans = 1L << OFFSET;
		int i = 0;
		while (oldans != ans) {
			i++;
			// System.out.println("sqrtdebug: " + flongToString(oldans) + " " +
			// flongToString(ans));
			// dirty hack to enforce return
			if (i > 100)
				return ans;
			oldans = ans;
			ans = (oldans + div(flong, oldans)) >> 1;
		}
		return ans;
	}