ruru 0.9.3

Native Ruby extensions in Rust
Documentation
1
2
3
4
5
6
7
8
9
10
11
use ruby_sys::float;

use types::Value;

pub fn float_to_num(num: f64) -> Value {
    unsafe { float::rb_float_new(num) }
}

pub fn num_to_float(num: Value) -> f64 {
    unsafe { float::rb_num2dbl(num) as f64 }
}