core/src/main/java/org/jruby/RubyNumeric.java
public static IRubyObject str2fnum(Ruby runtime, RubyString arg, boolean strict, boolean exception) {
        try {
            double value = ConvertDouble.byteListToDouble19(arg.getByteList(), strict);
            return RubyFloat.newFloat(runtime, value);
        } catch (NumberFormatException e) {
            if (strict) {
                if (!exception) return runtime.getNil();
                throw runtime.newArgumentError("invalid value for Float(): "
                        + arg.callMethod(runtime.getCurrentContext(), "inspect").toString());
            }
            return RubyFloat.newFloat(runtime, 0.0);
        }
    }
/**
     * Converts a string representation of a floating-point number to the
     * numeric value.  Parsing starts at the beginning of the string (after
     * leading and trailing whitespace have been removed), and stops at the
     * end or at the first character that can't be part of a number.  If
     * the string fails to parse as a number, 0.0 is returned.
     *
     * @param runtime  the ruby runtime
     * @param arg   the string to be converted
     * @param strict if true, enforce the strict criteria for String encoding of
     *               numeric values, as required by Float('n'), and raise an
     *               exception when those criteria are not met. Otherwise, allow
     *               lax expression of values, as permitted by String#to_f, and
     *               return a value in all cases.
     *               TODO: describe the rules/criteria
     * @return  a RubyFloat representing the result of the conversion, which
     *          will be 0.0 if the conversion failed.
     */
Converts a string representation of a floating-point number to the
numeric value.  Parsing starts at the beginning of the string (after
leading and trailing whitespace have been removed), and stops at the
end or at the first character that can't be part of a number.  If
the string fails to parse as a number, 0.0 is returned.

@param runtime  the ruby runtime
@param arg   the string to be converted
@param strict if true, enforce the strict criteria for String encoding of
numeric values, as required by Float('n'), and raise an
exception when those criteria are not met. Otherwise, allow
lax expression of values, as permitted by String#to_f, and
return a value in all cases.
TODO: describe the rules/criteria
@return  a RubyFloat representing the result of the conversion, which
will be 0.0 if the conversion failed.
Converts a string representation of a floating - point number to the numeric value . Parsing starts at the beginning of the string ( after leading and trailing whitespace have been removed ) and stops at the end or at the first character that can ' t be part of a number . If the string fails to parse as a number 0 . 0 is returned . @param runtime the ruby runtime @param arg the string to be converted @param strict if true enforce the strict criteria for String encoding of numeric values as required by Float ( ' n ' ) and raise an exception when those criteria are not met . Otherwise allow lax expression of values as permitted by String#to_f and return a value in all cases . TODO : describe the rules / criteria @return a RubyFloat representing the result of the conversion which will be 0 . 0 if the conversion failed .
public static IRubyObject str2fnum(Ruby runtime, RubyString arg, boolean strict, boolean exception) {
        try {
            double value = ConvertDouble.byteListToDouble19(arg.getByteList(), strict);
            return RubyFloat.newFloat(runtime, value);
        } catch (NumberFormatException e) {
            if (strict) {
                if (!exception) return runtime.getNil();
                throw runtime.newArgumentError("invalid value for Float(): "
                        + arg.callMethod(runtime.getCurrentContext(), "inspect").toString());
            }
            return RubyFloat.newFloat(runtime, 0.0);
        }
    }
public static IRubyObject str2fnum ( Ruby runtime , RubyString arg , boolean strict , boolean exception ) { try { double value = ConvertDouble . byteListToDouble19 ( arg . getByteList ( ) , strict ) ; return RubyFloat . newFloat ( runtime , value ) ; } catch ( NumberFormatException e ) { if ( strict ) { if ( ! exception ) return runtime . getNil ( ) ; throw runtime . newArgumentError ( "invalid value for Float(): " + arg . callMethod ( runtime . getCurrentContext ( ) , "inspect" ) . toString ( ) ) ; } return RubyFloat . newFloat ( runtime , 0.0 ) ; } }
Converts a string representation of a floating-point number to the
 numeric value.
Converts a string representation of a floating - point number to the numeric value .