BigDecimal nums = new BigSquareRoot().get(num.asBigDecimal());
BigDecimal dens = new BigSquareRoot().get(den.asBigDecimal());
try {
num = IntNum.valueOf(nums.toBigIntegerExact().toString());
den = IntNum.valueOf(dens.toBigIntegerExact().toString());
return context.runtime.newNumber(new IntFraction(num, den));
} catch(ArithmeticException e) {
// Ignore and fall through
}
}