Skip to content

v0.1.375 — str.format bare-radix negatives are sign-magnitude (PMAT-676)

Choose a tag to compare

@noahgift noahgift released this 15 Jun 15:52
· 14 commits to main since this release
39b7423

Correctness (PMAT-676): a bare-radix str.format spec over a negative int ("{:x}".format(-255), {:X}/{:o}/{:b}) now emits sign-magnitude (-ff) like Python, not Rust's two's-complement (ffffffffffffff01). The f-string path already did this (PMAT-613); .format() now shares the IntRadixStr lowering (sign + radix of unsigned_abs). Applied when the arg is referenced exactly once (a pre-scan ref-count keeps the in-place rewrite safe); a multi-reference arg keeps the existing embed (correct for non-negatives — no regression). Found by the HUNT-V5 differential hunt; verified vs python3 (hex/oct/bin/HEX, mixed fields, literal-surrounded). 433 e2e fixtures.