Opened 6 years ago

Closed 6 years ago

#12512 closed Bugs (fixed)

cpp_bin_float: convert_to<double> for numbers with absolute values smaller than 2**(INT_MIN+52) returns infinity instead of 0.

Reported by: Michael Shatz Owned by: John Maddock
Milestone: Boost 1.63.0 Component: multiprecision
Version: Boost 1.62.0 Severity: Problem
Keywords: Cc:

Description

Applying convert_to<double>() to cpp_bin_float object with absolute values in range (0..2(INT_MIN+52)] returns infinity. Similar bug exists with convert_to<double>(). Due to limits on exponent of cpp_bin_float the bug can be seen only when class Exponent = int64_t or wider.

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

Attachments (1)

cnv_under_test.cpp (393 bytes ) - added by Michael Shatz 6 years ago.
demonstrates cpp_bin_float convert_to<> bug

Download all attachments as: .zip

Change History (3)

by Michael Shatz, 6 years ago

Attachment: cnv_under_test.cpp added

demonstrates cpp_bin_float convert_to<> bug

comment:1 by Michael Shatz, 6 years ago

Your posting engine changed my post above in unexpected way. I think, it would be beneficiary for non-sophisticated people like me, if by default you engine will have WikiFormatting turned off. An option to turn it on can be provided for those of us who know what they are doing.

I meant to post:

Applying convert_to<double>() to cpp_bin_float object with absolute values in range (0..2**(INT_MIN+52)] returns infinity.
Similar bug exists with convert_to<float>().
Due to limits on exponent of cpp_bin_float the bug can be seen only when class Exponent = int64_t or wider.

comment:2 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.