Opened 6 years ago
Closed 6 years ago
#12524 closed Feature Requests (fixed)
cpp_bin_float: Anal fixation. Part 1. Sign of zero result of summation.
Reported by: | Michael Shatz | Owned by: | John Maddock |
---|---|---|---|
Milestone: | Boost 1.63.0 | Component: | multiprecision |
Version: | Boost 1.62.0 | Severity: | Cosmetic |
Keywords: | Cc: |
Description
IEEE-754 has one simple rule - subtraction of two equal finite numbers results in +0. From here follows that there are only two cases in which subtraction/addition of zeros results in -0:
-0 + -0 and -0 - +0. All other combinations results in +0.
Also from here follows that subtraction/addition of non-zeros with equal absolute value never results in -0.
I see no good reasons why boost::cpp_bin_float should not follow the same conventions. But right now it does not.
Attachments (1)
Change History (2)
by , 6 years ago
comment:1 by , 6 years ago
Milestone: | To Be Determined → Boost 1.63.0 |
---|---|
Resolution: | → fixed |
Status: | new → closed |
Fixed in https://github.com/boostorg/multiprecision/commit/5a5612c0a9c2de934a761b7e090b7c15466b2988, thanks for the report!
demonstrates non-IEEE sign of zero of cpp_bin_float addition/subtraction