(x: f64, y: f64)
| 44 | |
| 45 | #[plugin_fn] |
| 46 | fn pow(x: f64, y: f64) -> Result<f64> { |
| 47 | let r = libm::pow(x, y); |
| 48 | // libm yields NaN on a domain error such as a negative base with a fractional exponent. |
| 49 | if r.is_nan() && !x.is_nan() && !y.is_nan() { return Err(dom()); } |
| 50 | Ok(r) |
| 51 | } |
| 52 | |
| 53 | // Optional second positional `base`, matching `math.log(x[, base])`. |
| 54 | #[plugin_fn] |