MCPcopy Create free account
hub / github.com/dylan-sutton-chavez/edge-python / pow

Function pow

std/math/src/main/float.rs:46–51  ·  view source on GitHub ↗
(x: f64, y: f64)

Source from the content-addressed store, hash-verified

44
45#[plugin_fn]
46fn 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]

Callers 1

fpowfFunction · 0.85

Calls 1

domFunction · 0.70

Tested by

no test coverage detected