Opened 6 years ago

Closed 6 years ago

#12196 closed Bugs (fixed)

cpp_bin_float: convert_to<double> of infinity and NaN returns zero

Reported by: Michael Shatz Owned by: John Maddock
Milestone: To Be Determined Component: multiprecision
Version: Boost 1.61.0 Severity: Problem
Keywords: Cc:

Description

Applying convert_to<double>() to cpp_bin_float object with values of Inf and/or NaN returns 0. That is a new bug in the latest github version.

In Version 1.60.0 behavior is also not 100% correct, but better: inf.convert_to<double>() => 1.79769e+308 nan.convert_to<double>() => nan

Platform: Mingw, gcc 5.3.0, x64. All optimization levels.

Attachments (1)

infcnv_test.cpp (502 bytes ) - added by Michael Shatz 6 years ago.
demonstrates mistake in convert_to<double>() of special cpp_bin_float values

Download all attachments as: .zip

Change History (2)

by Michael Shatz, 6 years ago

Attachment: infcnv_test.cpp added

demonstrates mistake in convert_to<double>() of special cpp_bin_float values

comment:1 by John Maddock, 6 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.