(x: f64)
| 232 | // `modf(x) -> (fractional, integral)`, both with the sign of `x`. |
| 233 | #[plugin_fn] |
| 234 | fn modf(x: f64) -> Result<Handle> { |
| 235 | let integral = libm::trunc(x); |
| 236 | let frac = encode(Value::Float(x - integral))?; |
| 237 | let ip = encode(Value::Float(integral))?; |
| 238 | Handle::new_tuple(&[frac.raw(), ip.raw()]) |
| 239 | } |
| 240 | |
| 241 | // `frexp(x) -> (mantissa, exponent)` with `x == mantissa * 2**exponent`. |
| 242 | #[plugin_fn] |