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

Function sin

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

Source from the content-addressed store, hash-verified

246
247 #[pyfunction]
248 fn sin(x: ArgIntoFloat, vm: &VirtualMachine) -> PyResult<f64> {
249 let val = x.into_float();
250 pymath::math::sin(val).map_err(|err| match err {
251 pymath::Error::EDOM => {
252 vm.new_value_error(format!("expected a finite input, got {}", float_repr(val)))
253 }
254 _ => pymath_exception(err, vm),
255 })
256 }
257
258 #[pyfunction]
259 fn tan(x: ArgIntoFloat, vm: &VirtualMachine) -> PyResult<f64> {

Callers 4

_quartic_invcdf_estimateFunction · 0.90
cosine_kernelFunction · 0.90
gammaFunction · 0.90

Calls 2

pymath_exceptionFunction · 0.85
into_floatMethod · 0.80

Tested by 1

gammaFunction · 0.72