Skip to content

[float][gmp] Implement most of the methods for BigFloat#191

Merged
forfudan merged 3 commits intodevfrom
gmp
Apr 7, 2026
Merged

[float][gmp] Implement most of the methods for BigFloat#191
forfudan merged 3 commits intodevfrom
gmp

Conversation

@forfudan
Copy link
Copy Markdown
Owner

@forfudan forfudan commented Apr 7, 2026

This PR implements most of the methods for the 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 BigFloat core API: constructors, arithmetic, comparisons, transcendentals, and BigDecimal conversion.
  • Extend the C/FFI layer with raw-digit export (mpfr_get_str) to speed up BigFloat → BigDecimal.
  • Add BigFloat tests + runner script, plus Pixi tasks and a GitHub Actions job to run them.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 BigFloat core API: constructors, arithmetic, comparisons, transcendentals, and BigDecimal conversion.
  • Extend the C/FFI layer with raw-digit export (mpfr_get_str) to speed up BigFloat → 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.

@forfudan forfudan merged commit f0fd648 into dev Apr 7, 2026
31 of 33 checks passed
@forfudan forfudan deleted the gmp branch April 7, 2026 21:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants