Skip to main content

try_from_sexp_coerced_f64

Function try_from_sexp_coerced_f64 

Source
#[doc(hidden)]
pub fn try_from_sexp_coerced_f64(sexp: SEXP) -> Result<f64, SexpError>
Expand description

Convert a coerce native f64 parameter.

REALSXP takes exactly the bare conversion (NA_real_ passes through). Integers, logicals, and raws widen losslessly, and an integer or logical NA becomes NA_real_ as as.numeric() would produce it: the declared type can carry NA, so coercion propagates it rather than inventing an error.