MCPcopy Index your code
hub / github.com/RustPython/RustPython / fabs

Function fabs

crates/stdlib/src/math.rs:29–31  ·  view source on GitHub ↗
(x: ArgIntoFloat, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

27 // Number theory functions:
28 #[pyfunction]
29 fn fabs(x: ArgIntoFloat, vm: &VirtualMachine) -> PyResult<f64> {
30 pymath::math::fabs(x.into_float()).map_err(|err| pymath_exception(err, vm))
31 }
32
33 #[pyfunction]
34 fn isfinite(x: ArgIntoFloat) -> bool {

Callers 5

overlapMethod · 0.90
__mul__Method · 0.90
__truediv__Method · 0.90
_normal_dist_inv_cdfFunction · 0.90
RelativeErrorMethod · 0.90

Calls 2

pymath_exceptionFunction · 0.85
into_floatMethod · 0.80

Tested by 1

RelativeErrorMethod · 0.72