IssueRaiser

My understanding is that the reasoning behind all this is: - In 1985 there were a ton of different hardware floating-point implementatio...

My understanding is that the reasoning behind all this is: - In 1985 there were a ton of different hardware floating-point implementations with incompatible instructions, making it a nightmare to write floating-point code once that worked on multiple machines - To address the compatibility problem, IEEE came up with a hardware standard that could do error handling using only CPU registers (no software, since it's a hardware standard) - With that design constraint, they (reasonably imo) chose to handle errors by making them "poisonous" - once you have a NaN, all operations on it fail, including equality, so the error state propagates rather than potentially accidentally "un-erroring" if you do another operation, leading you into undefined behavior territory - The standard solved the problem when hardware manufacturers adopted it - The upstream consequence on software is that if your programming language does anything other than these exact floating-point semantics , the cost is losing hardware acceleration, which makes your floating-point operations way slower

Posted by rtfeldman on Oct 30, 2025, 3:01 PM

Tags

Related issues

Raise real-world problems, find people facing the same issue, and discuss solutions.2,000 issues0 comments

pricing (SaaS)

My understanding is that the reasoning behind all this is: - In 1985 there were a ton of different hardware floating-point implementatio...

rtfeldmanOct 30, 2025, 3:01 PM

My understanding is that the reasoning behind all this is: - In 1985 there were a ton of different hardware floating-point implementations with incompatible instructions, making it a nightmare to write floating-point code once that worked on multiple machines - To address the compatibility problem, IEEE came up with a hardware standard that could do error handling using only CPU registers (no software, since it's a hardware standard) - With that design constraint, they (reasonably imo) chose to handle errors by making them "poisonous" - once you have a NaN, all operations on it fail, including equality, so the error state propagates rather than potentially accidentally "un-erroring" if you do another operation, leading you into undefined behavior territory - The standard solved the problem when hardware manufacturers adopted it - The upstream consequence on software is that if your programming language does anything other than these exact floating-point semantics , the cost is losing hardware acceleration, which makes your floating-point operations way slower

Comments (0)

No comments yet. Start the discussion.

Comment on this issue