pass_single_double: Multiplies a double by 10 in Rust

Description Usage Arguments Details Value Examples

View source: R/extendr-wrappers.R

Description

Demonstrates passing a double value back and forth between R and Rust, multiplies it by 10 in Rust to prove it works.

Usage

1

Arguments

f

A double (float) value to treat as an f64 in Rust

Details

The value passed to this function must be a double, which is the default numeric type in R, or an NA_real_. The Rust function signature is fn pass_single_float_fn(f: Option<f64>) -> Option<f64>, with NA's being handled as None in Rust. The native R double is double-precision floating point number, equivalent to Rust's f64.

Value

f * 10

Examples

1
2
3

ericwburden/rustbind documentation built on April 10, 2021, 12:31 p.m.