Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: RustPython/pymath
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: RustPython/pymath
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: align-cpython
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 3 commits
  • 9 files changed
  • 1 contributor

Commits on Mar 13, 2026

  1. O(1) bit-level nextafter with steps parameter

    Replace the O(n) loop in nextafter(x, y, steps) with O(1) IEEE 754
    bit manipulation matching math_nextafter_impl in mathmodule.c.
    Handles sign-crossing, saturation, and all edge cases.
    
    Add pyo3 proptest and edge/extreme-step tests for nextafter.
    youknowone committed Mar 13, 2026
    Configuration menu
    Copy the full SHA
    3ae1ee1 View commit details
    Browse the repository at this point in the history
  2. Fix cmath.log error propagation and bigint log precision

    cmath: Rewrite log(z, base) to match cmath_log_impl errno
    semantics. c_log always returns a value and separately reports
    EDOM for zero. c_quot returns EDOM and (0,0) for zero
    denominator instead of NaN.
    
    bigint: Add sticky bit to frexp_bigint for correct IEEE
    round-half-to-even, matching _PyLong_Frexp. Use mul_add for
    log/log2/log10 bigint to match loghelper fma usage.
    
    Add regression tests for remainder tie-to-even and signed zero.
    youknowone committed Mar 13, 2026
    Configuration menu
    Copy the full SHA
    0ad0cb0 View commit details
    Browse the repository at this point in the history

Commits on Mar 14, 2026

  1. Document design decisions and improve sumprod

    - math_1/math_2: document why errno handling differs from
      CPython (platform-specific unreliability, output checks
      sufficient, verified by proptest)
    - math.log: document EDOM substitution for ZeroDivisionError
    - math.remainder: document libm delegation rationale
    - sumprod: return Result for length mismatch instead of panic,
      improve overflow fallback to continue from where the fast
      path stopped instead of restarting from scratch
    youknowone committed Mar 14, 2026
    Configuration menu
    Copy the full SHA
    57f01ee View commit details
    Browse the repository at this point in the history
Loading