ucrt: scale hexadecimal floats with scalbn in strtod #71
No reviewers
Labels
No labels
accessibility
bug
claimed
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
tester report
urgent
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/LakshanSivakumar--Native-Victory-macOS!71
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-71"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@Olima34 on GitHub · 2026-11-26 13:41 UTC · original
Olima34:fix/ucrt-strtod-hex-scale→main· +22 −2 · 2 files · 2 commits · merged 2026-11-26 15:47 UTCWhat this changes
strtod's hexadecimal path multiplied the mantissa by2f64.powi(exponent). Below 2^-1022 that power is 0, so whatprintf("%a")writes for small numbers read back as 0 (0x1.0000000000000p-1000,0x1p-1074). For a zero mantissa with a large exponent it made0 * inf, a NaN then turned into an infinity withERANGE, so0x0p2000read as +inf. The value is now scaled with onescalbn(libm's, as the math functions use), exact at both ends.New test
hex_doubles_scale_exactly_at_both_ends:%a's 2^-1000, the smallest subnormal, a negative subnormal,DBL_MAX,0x0p2000(0, noERANGE) and0x1p1024(inf,ERANGE).How it was tested
cargo test --target x86_64-apple-darwin -p victory-hle -p victory-loader -p victory(all pass, native probe tests included)cargo clippy --workspace --all-targets --locked --target x86_64-pc-windows-gnullvm -- -D warnings, also with--all-features; clippy forx86_64-apple-darwinreports nothing in the files touched (host_posixis not built for Windows)cargo test --workspaceandcargo xtask policymainand passes with the changeChecklist
VICTORY_*variable and documented (none added)@LakshanSivakumar on GitHub · 2026-11-26 14:55 UTC · original · approved these changes
One scalbn fixes the underflow-to-zero and 0*inf cases. Thanks.