Function rb_Float

Source
pub unsafe extern "C" fn rb_Float(val: VALUE) -> VALUE
Expand description

This is the logic behind Kernel#Float. Numeric types are converted directly to the nearest value that a Float can represent. Strings are interpreted strictly; only leading/trailing whitespaces are allowed except what strtod understands. Anything else are converted using #to_f.

This is slightly stricter than String#to_f.

ยง@param[in] val An object to convert. @exception rb_eArgError Malformed val passed. @exception rb_eTypeError No conversion defined. @return An instance of ::rb_cFloat.

Generated by rb-sys for Ruby mri-x86_64-linux-gnu-3.2.3