(args: IsCloseArgs, vm: &VirtualMachine)
| 59 | |
| 60 | #[pyfunction] |
| 61 | fn isclose(args: IsCloseArgs, vm: &VirtualMachine) -> PyResult<bool> { |
| 62 | let a = args.a.into_float(); |
| 63 | let b = args.b.into_float(); |
| 64 | let rel_tol = args.rel_tol.into_option().map(|v| v.into_float()); |
| 65 | let abs_tol = args.abs_tol.into_option().map(|v| v.into_float()); |
| 66 | |
| 67 | pymath::math::isclose(a, b, rel_tol, abs_tol) |
| 68 | .map_err(|_| vm.new_value_error("tolerances must be non-negative")) |
| 69 | } |
| 70 | |
| 71 | #[pyfunction] |
| 72 | fn copysign(x: ArgIntoFloat, y: ArgIntoFloat, vm: &VirtualMachine) -> PyResult<f64> { |
no test coverage detected