* @param value the double value to convert to a fraction.
* @exception MathIllegalArgumentException if value is NaN or infinite
*/
public BigFraction(final double value) throws MathIllegalArgumentException {
if (Double.isNaN(value)) {
throw new MathIllegalArgumentException(LocalizedFormats.NAN_VALUE_CONVERSION);
}
if (Double.isInfinite(value)) {
throw new MathIllegalArgumentException(LocalizedFormats.INFINITE_VALUE_CONVERSION);
}
// compute m and k such that value = m * 2^k
final long bits = Double.doubleToLongBits(value);
final long sign = bits & 0x8000000000000000L;