private static BigInteger roundToLeadBit(BigInteger i, int newLeadBit) {
		int amt = leadBit(i) - newLeadBit;
		if (amt == 0) {
			return i;
		}
		if (amt < 0) {
			return i.shiftLeft(-amt);
		}

		// round to nearest even
		int midbit = amt - 1;
		boolean midset = i.testBit(midbit);
		boolean eps = i.getLowestSetBit() < midbit;
		i = i.shiftRight(amt);
		boolean odd = i.testBit(0);
		if (midset && (eps || odd)) {
			i = i.add(BigInteger.ONE);
		}
		return i;
	}
right shift and round to nearest even or left shift to an integer with lead bit at
newLeadBit.

The final round up might cause a carry that propagates up, so this must be followed by a
test.

@param i integer representation of mantissa 1.xxxxx
@param newLeadBit the bit position we want as a new lead bit
@return integer representing 1.yyyy with a new lead bit position
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/pcode/floatformat/FloatFormat.java