core/src/main/java/org/jruby/RubyNumeric.java
public static boolean fixable(Ruby runtime, double f) {
        if (Double.isNaN(f) || Double.isInfinite(f))  {
            throw runtime.newFloatDomainError(Double.toString(f));
        }
        long l = (long) f;
        if (l == RubyFixnum.MIN || l == RubyFixnum.MAX) {
            BigInteger bigint = BigDecimal.valueOf(f).toBigInteger();
            return posFixable(bigint) && negFixable(bigint);
        }
        return posFixable(f) && negFixable(f);
    }
// Note: this does additional checks for inf and nan
this does additional checks for inf and nan
this does additional checks for inf and nan
public static boolean fixable(Ruby runtime, double f) {
        if (Double.isNaN(f) || Double.isInfinite(f))  {
            throw runtime.newFloatDomainError(Double.toString(f));
        }
        long l = (long) f;
        if (l == RubyFixnum.MIN || l == RubyFixnum.MAX) {
            BigInteger bigint = BigDecimal.valueOf(f).toBigInteger();
            return posFixable(bigint) && negFixable(bigint);
        }
        return posFixable(f) && negFixable(f);
    }
public static boolean fixable ( Ruby runtime , double f ) { if ( Double . isNaN ( f ) || Double . isInfinite ( f ) ) { throw runtime . newFloatDomainError ( Double . toString ( f ) ) ; } long l = ( long ) f ; if ( l == RubyFixnum . MIN || l == RubyFixnum . MAX ) { BigInteger bigint = BigDecimal . valueOf ( f ) . toBigInteger ( ) ; return posFixable ( bigint ) && negFixable ( bigint ) ; } return posFixable ( f ) && negFixable ( f ) ; }
Note: this does additional checks for inf and nan
Note : this does additional checks for inf and nan