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

Function tan

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

Source from the content-addressed store, hash-verified

257
258 #[pyfunction]
259 fn tan(x: ArgIntoFloat, vm: &VirtualMachine) -> PyResult<f64> {
260 let val = x.into_float();
261 pymath::math::tan(val).map_err(|err| match err {
262 pymath::Error::EDOM => {
263 vm.new_value_error(format!("expected a finite input, got {}", float_repr(val)))
264 }
265 _ => pymath_exception(err, vm),
266 })
267 }
268
269 #[pyfunction]
270 fn degrees(x: ArgIntoFloat) -> f64 {

Callers 1

sigmoid_kernelFunction · 0.90

Calls 2

pymath_exceptionFunction · 0.85
into_floatMethod · 0.80

Tested by

no test coverage detected