Function rb_Integer

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

This is the logic behind Kernel#Integer. Numeric types are converted directly, with floating point numbers being truncated. Strings are interpreted strictly; only leading/trailing whitespaces, plus/minus sign, radix indicators such as 0x, digits, and underscores are allowed. Anything else are converted by first trying #to_int, then #to_i.

This is slightly stricter than String#to_i.

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

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