Conversation
There was a problem hiding this comment.
Pull request overview
Implements an MPFR-backed BigFloat type (via the existing GMP/MPFR C wrapper) and wires it into the Decimo package, including a dedicated build/run test path and CI coverage for environments with MPFR installed.
Changes:
- Add
BigFloatcore API: constructors, arithmetic, comparisons, transcendentals, and BigDecimal conversion. - Extend the C/FFI layer with raw-digit export (
mpfr_get_str) to speed upBigFloat → BigDecimal. - Add BigFloat smoke tests + runner script, plus Pixi tasks and a GitHub Actions job to run them.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_bigfloat.sh | Adds a script to build/link the wrapper and execute BigFloat Mojo tests as binaries. |
| tests/bigfloat/test_bigfloat.mojo | Adds BigFloat smoke tests for construction, ops, transcendentals, and conversions. |
| src/decimo/gmp/gmp_wrapper.c | Adds raw-digit export/free helpers using mpfr_get_str/mpfr_free_str. |
| src/decimo/bigfloat/mpfr_wrapper.mojo | Adds Mojo FFI bindings + doc improvements for MPFR wrapper functions. |
| src/decimo/bigfloat/bigfloat.mojo | Implements BigFloat including fast to_bigdecimal packing path. |
| src/decimo/bigfloat/init.mojo | Re-exports BigFloat and aliases from the bigfloat subpackage. |
| src/decimo/init.mojo | Exposes BigFloat (and aliases) from the top-level decimo package. |
| pixi.toml | Adds wrapper build + BigFloat test tasks; adjusts doc task invocation. |
| docs/plans/gmp_integration.md | Expands MPFR/BigFloat design + usage documentation (needs syncing with code). |
| .github/workflows/run_tests.yaml | Adds a BigFloat CI job (with MPFR installed) and a doc generation job. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR implements most of the methods for the MPFR-backed
BigFloattype (via the existing GMP/MPFR C wrapper) and wires it into the Decimo package, including a dedicated build/run test path and CI coverage for environments with MPFR installed.Changes:
BigFloatcore API: constructors, arithmetic, comparisons, transcendentals, and BigDecimal conversion.mpfr_get_str) to speed upBigFloat → BigDecimal.BigFloattests + runner script, plus Pixi tasks and a GitHub Actions job to run them.