Skip to main content

NUM2DBL

Function NUM2DBL 

Source
pub unsafe fn NUM2DBL(obj: VALUE) -> c_double
Expand description

Convert Ruby numeric to C double (akin to NUM2DBL).

Works for Float (including Flonum), Fixnum, and other numeric types.

@param[in] obj A Ruby numeric object. @return C double representation.

ยงSafety

This function is unsafe because it may dereference a raw pointer to access underlying Ruby data. The caller must ensure the VALUE is a valid Ruby numeric.