Skip to content

Fix float_to_str for negative values and zero-padding#119

Open
ColtonPayne wants to merge 1 commit intomainfrom
fix-bug-102-103
Open

Fix float_to_str for negative values and zero-padding#119
ColtonPayne wants to merge 1 commit intomainfrom
fix-bug-102-103

Conversation

@ColtonPayne
Copy link
Collaborator

Summary

Test plan

  • Added test_float_to_str_negative_values — parametrized over 3 negative float cases
  • Added test_float_to_str_zero_padding — parametrized over 4 leading-zero cases
  • Added test_float_to_str_negative_with_zero_padding — parametrized over 2 combined cases
  • All 14 new test cases run against both interpretation_fp and interpretation backends
  • Full test suite passes (434 passed, 37 skipped in disable_jit; 7 passed in dont_disable_jit)

Closes #93
Closes #94

🤖 Generated with Claude Code

Use abs() before modulo to prevent Python's modulo returning incorrect
positive remainders for negative floats (BUG-102). Add 3-digit zero-
padding to preserve leading zeros in the fractional part (BUG-103).
Use round() instead of int() to avoid floating-point truncation errors.

Applied to interpretation.py, interpretation_fp.py, and
interpretation_parallel.py. Added parametrized tests covering negative
values, zero-padding, and combined cases across both backends.

Also guard .cache_status.yaml write so test runners (pytest/unittest)
no longer dirty the repo file during pre-commit hooks.

Closes #93
Closes #94

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@ColtonPayne ColtonPayne added Ready for Review Awaiting PR Review AI PR contains AI Generated Code labels Feb 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI PR contains AI Generated Code Ready for Review Awaiting PR Review

Projects

None yet

2 participants