(x: ArgIntoFloat, vm: &VirtualMachine)
| 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> { |