Opened 7 years ago
Closed 7 years ago
#12090 closed Bugs (fixed)
cpp_dec_float has broken infinity
Reported by: | anonymous | Owned by: | John Maddock |
---|---|---|---|
Milestone: | To Be Determined | Component: | multiprecision |
Version: | Boost 1.60.0 | Severity: | Problem |
Keywords: | cpp_dec_float infinity | Cc: | scottopoly@… |
Description
output of following program should be "inf", but instead is "-14".
#include <iostream> #include <boost/multiprecision/cpp_dec_float.hpp> typedef boost::multiprecision::number< boost::multiprecision::cpp_dec_float< 30, boost::int16_t > > money_t; int main( int argc, char * * argv ) {
money_t a( 7 ); money_t b( 7 ); std::cout << std::numeric_limits< money_t >::infinity( ) - ( a + b ) << std::endl; return 0;
}
Change History (2)
comment:1 by , 7 years ago
Cc: | added |
---|
comment:2 by , 7 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
Confirmed, fixed in https://github.com/boostorg/multiprecision/commit/c4e847b9fdc70547033e7dd56cf0d088ed737b84