Boost logo

Boost :

Subject: [boost] [multiprecision] Bug in double to cpp_bin_float conversion?
From: Rob Conde (rob.conde_at_[hidden])
Date: 2016-04-13 17:32:12

Consider the following code:

#include <boost/multiprecision/cpp_bin_float.hpp>
#include <iostream>

int main()
    typedef boost::multiprecision::cpp_bin_float_quad float128_t;

    float128_t f1(1e-9);

    float128_t f2("1e-9");

    std::cout << std::setprecision(std::numeric_limits<float128_t>::max_digits10);

    std::cout << f1 << std::endl;
    std::cout << f2 << std::endl;

    return 0;

I'm getting as output:


The conversion of the double literal is not as expected.

On wand box:

Is this a bug? If not, what would be the correct way to get my expected behavior?


Rob Conde

Boost list run by bdawes at, gregod at, cpdaniel at, john at