Skip to content

Fix #11050: clarify FloatingPointControl invalidException docs#11061

Open
AayushMainali-Github wants to merge 2 commits into
dlang:masterfrom
AayushMainali-Github:fix-11050-floatingpointcontrol-docs
Open

Fix #11050: clarify FloatingPointControl invalidException docs#11061
AayushMainali-Github wants to merge 2 commits into
dlang:masterfrom
AayushMainali-Github:fix-11050-floatingpointcontrol-docs

Conversation

@AayushMainali-Github

Copy link
Copy Markdown

Rationale

FloatingPointControl documentation incorrectly claimed that enabling invalidException / severeExceptions traps on "uninitialized" floating-point variables.

That is inaccurate: an uninitialized float may hold a valid bit pattern, and default-initialized floating-point values in D are quiet NaNs, which do not by themselves raise the invalid-operation exception.

This updates the module docs and example to describe actual invalid operations (e.g. 0.0/0.0) and to state that quiet NaNs / default-initialized floats do not trigger that trap on their own.

Feature request or issue tracking

Closes #11050.

Pre-review checklist

  • I have performed a self-review of my code.
  • If my PR fixes a bug or introduces a new feature, I have added thorough tests.
  • If my changes are non-trivial and do not concern a reported issue, I have added a changelog entry.

LLM/AI disclosure

This PR was written with the assistance of an LLM/AI.

@ibuclaw

ibuclaw commented Jul 11, 2026

Copy link
Copy Markdown
Member

To fair, it was accurate 10 years ago.

dlang/dmd#9897

Comment thread std/math/hardware.d Outdated
Comment thread std/math/hardware.d Outdated
Comment thread std/math/hardware.d Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

std.math.hardware FloatingPointControl should not mention uninitialized variables

3 participants