Skip to content

fixes three bugs in hex float parsing - #7622

Merged
Kelimion merged 3 commits into
odin-lang:masterfrom
MatzeOGH:hex_float_literals
Sep 24, 2026
Merged

Kelimion merged 3 commits into
odin-lang:masterfrom
MatzeOGH:hex_float_literals

Conversation

@MatzeOGH

Copy link
Copy Markdown
Contributor
  • A hex letter digit (a-f) did not reset the trailing-zero counter, so
    digits after a zero were stripped: "0x1.0fp0" gave 1.0 (expected 1.05859375).

  • The loop that shifts a too-long mantissa down used the same condition as
    the loop that shifts it up, so it never ran. Mantissas with more than 55
    bits were not rounded: "0x1.123456789abcdef0p0" gave 0.0243...

  • Denormalization used if instead of for, so subnormal results were
    wrong: "0x1p-1074" gave 0h0008000000000000 instead of 0h0000000000000001.

@MatzeOGH MatzeOGH changed the title fix three bugs in hex float parsing fixes three bugs in hex float parsing Sep 24, 2026
@Kelimion
Kelimion merged commit 70fa7db into odin-lang:master Sep 24, 2026
7 checks passed
@MatzeOGH
MatzeOGH deleted the hex_float_literals branch September 24, 2026 11:28
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