Skip to content

Fix sign of zero results in DSLX apfloat FMA. - #5439

Merged
copybara-service[bot] merged 1 commit into
mainfrom
test_1023853953
Nov 17, 2026
Merged

copybara-service[bot] merged 1 commit into
mainfrom
test_1023853953

Conversation

@copybara-service

Copy link
Copy Markdown

Fix sign of zero results in DSLX apfloat FMA.

When the result of an FMA operation is zero, the result is now negative only if both a * b and c are negative, rather than unconditionally positive. Also adds a quickcheck test verifying FMA equivalence with add(mul(a, b), c) on exact small integers.

This follows IEEE 754-2008 § 6.3.

Fixes: #5418

When the result of an FMA operation is zero, the result is now negative only if both `a * b` and `c` are negative, rather than unconditionally positive. Also adds a quickcheck test verifying FMA equivalence with `add(mul(a, b), c)` on exact small integers.

This follows IEEE 754-2008 § 6.3.

Fixes: #5418
PiperOrigin-RevId: 1023945619
@copybara-service
copybara-service Bot merged commit 6e6e19d into main Nov 17, 2026
7 checks passed
@copybara-service
copybara-service Bot deleted the test_1023853953 branch November 17, 2026 20:23

This branch was previously deployed

1 inactive deployment
github-pages — 6e6e19d8 Deployed Nov 17, 2026 by copybara-service[bot] via deploy #14540
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.

apfloat::fma returns +0 for a negative zero product plus a negative zero

1 participant