public BigDecimal toBigDecimal() {
		switch (kind) {
			case FINITE:
				if (isZero()) {
					return BigDecimal.ZERO;
				}
				int unusedBits = Math.max(unscaled.getLowestSetBit(), 0);
				BigInteger val = unscaled;
				int iscale = scale - fracbits + 1;
				BigDecimal x;
				if (iscale >= -unusedBits) {
					x = new BigDecimal(val.shiftLeft(iscale));
				}
				else {
					if (unusedBits > 0) {
						val = unscaled.shiftRight(unusedBits);
						iscale += unusedBits;
					}
					x = new BigDecimal(val.multiply(BigInteger.valueOf(5).pow(-iscale)),
						-iscale);
				}
				if (sign < 0) {
					x = x.negate();
				}
				return x;
			case INFINITE:
				return sign < 0 ? BIG_NEGATIVE_INFINITY : BIG_POSITIVE_INFINITY;
			case QUIET_NAN:
			case SIGNALING_NAN:
				return null;
			default:
				throw new AssertionError("unknown BigFloat kind: " + kind);
		}
	}
If finite, the returned BigDecimal is exactly equal to this.  If not finite, one of the
FloatFormat.BIG_* constants is returned.

@return a BigDecimal or null if value is NaN (i.e., {@link FloatKind#QUIET_NAN} or 
{@link FloatKind#SIGNALING_NAN}).
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/pcode/floatformat/BigFloat.java