(
x: Either<PyRef<PyFloat>, PyIntRef>,
i: PyIntRef,
vm: &VirtualMachine,
)
| 406 | |
| 407 | #[pyfunction] |
| 408 | fn ldexp( |
| 409 | x: Either<PyRef<PyFloat>, PyIntRef>, |
| 410 | i: PyIntRef, |
| 411 | vm: &VirtualMachine, |
| 412 | ) -> PyResult<f64> { |
| 413 | let value = match x { |
| 414 | Either::A(f) => f.to_f64(), |
| 415 | Either::B(z) => try_bigint_to_f64(z.as_bigint(), vm)?, |
| 416 | }; |
| 417 | pymath::math::ldexp_bigint(value, i.as_bigint()).map_err(|err| pymath_exception(err, vm)) |
| 418 | } |
| 419 | |
| 420 | #[pyfunction] |
| 421 | fn cbrt(x: ArgIntoFloat, vm: &VirtualMachine) -> PyResult<f64> { |