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)

af_p1.cpp (1.8 KB ) - added by Michael Shatz 6 years ago.
demonstrates non-IEEE sign of zero of cpp_bin_float addition/subtraction

Download all attachments as: .zip

Change History (2)

by Michael Shatz, 6 years ago

Attachment: af_p1.cpp added

demonstrates non-IEEE sign of zero of cpp_bin_float addition/subtraction

comment:1 by John Maddock, 6 years ago

Milestone: To Be DeterminedBoost 1.63.0
Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.