ucrt: ilogb of a NaN is FP_ILOGBNAN, INT_MAX, as in the CRT #97
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!97
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-97"
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 14:29 UTC · original
Olima34:fix/ucrt-ilogb-nan→main· +13 −1 · 1 files · 2 commits · merged 2026-11-26 15:23 UTCWhat this changes
ilogbcalled macOS's libm, whoseFP_ILOGBNANequals itsFP_ILOGB0,INT_MIN, so a NaN looked like a zero. The CRT'sFP_ILOGBNANis0x7fffffff(corecrt_math.h), which Microsoft'silogbreference returns for NaNs and infinities alike; macOS already givesINT_MAXfor an infinity.ilogbffollows. New testilogb_gives_the_crts_special_values.How it was tested
cargo test --target x86_64-apple-darwin -p victory-hle -p victory-loader -p victory(all pass); the new test fails onmaincargo 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 file touchedcargo test --workspaceandcargo xtask policyChecklist
VICTORY_*variable and documented (none added)@LakshanSivakumar on GitHub · 2026-11-26 14:55 UTC · original · approved these changes
ilogb(NaN) is INT_MAX like the CRT, and ilogbf follows. Thanks.