(x: ArgIntoFloat, vm: &VirtualMachine)
| 219 | |
| 220 | #[pyfunction] |
| 221 | fn cos(x: ArgIntoFloat, vm: &VirtualMachine) -> PyResult<f64> { |
| 222 | let val = x.into_float(); |
| 223 | pymath::math::cos(val).map_err(|err| match err { |
| 224 | pymath::Error::EDOM => { |
| 225 | vm.new_value_error(format!("expected a finite input, got {}", float_repr(val))) |
| 226 | } |
| 227 | _ => pymath_exception(err, vm), |
| 228 | }) |
| 229 | } |
| 230 | |
| 231 | #[pyfunction] |
| 232 | fn hypot(coordinates: PosArgs<ArgIntoFloat>) -> f64 { |
no test coverage detected