Opened 3 months ago

Closed 8 weeks ago

#13301 closed Bugs (fixed)

boost multiprecision conversion from binary float to int types fails for large floats

Reported by: marc.alexa@… Owned by: John Maddock
Milestone: To Be Determined Component: multiprecision
Version: Boost 1.64.0 Severity: Problem
Keywords: Cc:


It appears the conversion from binary float types such as

typedef number<cpp_bin_float<8,backends::digit_base_2> > quarter_float;

to integer types fails if the float is 28 or larger. For example, using

quarter_float qf(256);
cpp_int i = qf.convert_to<cpp_int>();
unsigned int n = qf.convert_to<unsigned int>();

I get 0 for i and 4294967295 for n.

A try to attach a full code example.

Attachments (1) (1.0 KB) - added by marc.alexa@… 3 months ago.

Download all attachments as: .zip

Change History (3)

Changed 3 months ago by marc.alexa@…

Attachment: added

comment:1 Changed 2 months ago by John Maddock

Confirmed, investigating, thanks.

comment:2 Changed 8 weeks ago by John Maddock

Resolution: fixed
Status: newclosed

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain John Maddock.
The resolution will be deleted.

Add Comment

E-mail address and name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.