code: public static BigRational valueOf(double value) {
  		if (value == 0.0) {
  			return ZERO;
  		}
  		if (value == 1.0) {
  			return ONE;
  		}
  		if (Double.isInfinite(value)) {
  			throw new NumberFormatException("Infinite");
  		}
  		if (Double.isNaN(value)) {
  			throw new NumberFormatException("NaN");
  		}
  		return valueOf(new BigDecimal(String.valueOf(value)));
  	}
docs: Creates a rational number of the specified double value.
  
  @param value the double value
  @return the rational number
  @throws NumberFormatException if the double value is Infinite or NaN.