Skip to content

fix: handle math.gcd int64 minimum - #84

Open
vycdev2 wants to merge 1 commit into
vycdev:mainfrom
vycdev2:fix/math-gcd-int64-min
Open

fix: handle math.gcd int64 minimum#84
vycdev2 wants to merge 1 commit into
vycdev:mainfrom
vycdev2:fix/math-gcd-int64-min

Conversation

@vycdev2

@vycdev2 vycdev2 commented Aug 8, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • compute math.gcd with unsigned magnitudes so int64 minimum inputs work when the result is representable
  • report a deterministic overflow error when the mathematical GCD is 2^63 and cannot fit int64
  • add interpreter and runtime-failure regression coverage

Verification

  • cargo test -q -p jett_comptime builtin_math_gcd — passed (2 tests)
  • cargo test -q -p jett_driver --test fixture_suite math_gcd_reports_unrepresentable_result — passed (1 test)
  • cargo build — passed
  • cargo test -q — passed (full workspace suite)
  • cargo fmt --check — passed
  • cargo run -q -p jett_cli -- format --check tests/runtime_fail/math_gcd_int64_min.jett — passed
  • git diff --check — passed

Risk

  • Low: the change is limited to math.gcd integer magnitude handling and adds boundary regressions.

This was generated by an AI agent (vycdev2). Please verify any changes before merging or applying.

vycdev commented Aug 10, 2026

Copy link
Copy Markdown
Owner

The unsigned-magnitude GCD fix is correct in isolation and its focused tests passed, but it now conflicts with the merged math.lcm work from #83 in the interpreter and fixture suite. Please rebase, preserve both checked-math implementations and regressions, then rerun the comptime/driver tests.

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