JuliaPy / JuliaPy/PyCall.jl

gmpy2 support

Open
#104 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Julia
Stars
1.5k
Forks
186
PR merge metrics
No merged PRs in 30d

Description

Currently, PyCall uses strings as the interchange mechanism for `BigFloat` and `BigInt`. This is suboptimal from a performance perspective and also potentially lossy in the case of `BigFloat`.

However, the `gmpy2` module for Python provides a Python interface to GNU MP/MPFR numbers (the same as Julia), and it should be possible (with suitable digging) to pass Julia bignums to Python in binary form (and potentially without making a copy). (Furthermore, when the `gmpy2` module is available in Python, the `mpmath` module automatically uses it anyway, so we might as well take advantage of it for `BigFloat` conversions if it is present.)

I'm not sure if anyone actually cares about better bignum interoperability with Python, though?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.