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

Function acos

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

Source from the content-addressed store, hash-verified

185 // Trigonometric functions:
186 #[pyfunction]
187 fn acos(x: ArgIntoFloat, vm: &VirtualMachine) -> PyResult<f64> {
188 let val = x.into_float();
189 pymath::math::acos(val).map_err(|err| match err {
190 pymath::Error::EDOM => vm.new_value_error(format!(
191 "expected a number in range from -1 up to 1, got {}",
192 float_repr(val)
193 )),
194 _ => pymath_exception(err, vm),
195 })
196 }
197
198 #[pyfunction]
199 fn asin(x: ArgIntoFloat, vm: &VirtualMachine) -> PyResult<f64> {

Callers 1

parabolic_kernelFunction · 0.90

Calls 2

pymath_exceptionFunction · 0.85
into_floatMethod · 0.80

Tested by

no test coverage detected