Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

boost::multiprecision::float128 and C++11

Tags:

c++

c++11

boost

I'm trying to use boost::multiprecision::float128 (boost 1.55.0) under C++11 (gcc 4.8.1), but get the following compiler error:

/cm/shared/apps/boost/gcc/1.55.0/include/boost/multiprecision/float128.hpp: In static member function ‘static std::numeric_limits<boost::multiprecision::number<boost::multiprecision::backends::float128_backend, ET> >::number_type std::numeric_limits<boost::multiprecision::number<boost::multiprecision::backends::float128_backend, ET> >::min()’:
/cm/shared/apps/boost/gcc/1.55.0/include/boost/multiprecision/float128.hpp:533:55: error: unable to find numeric literal operator ‘operator"" Q’
    static number_type (min)() BOOST_NOEXCEPT { return 3.36210314311209350626267781732175260e-4932Q; }

Can't I use boost::multiprecision::float128 in C++11? Or how else do I get it working?

edit

Just to clarify. This error is generated by

#include <boost/multiprecision/float128.hpp>

The compiler is not happy with the statement

return 3.36210314311209350626267781732175260e-4932Q;

in particular the Q is confusing it. I used the compiler flags -std=c++11 -fabi-version=0 -march=native -mfpmath=sse

like image 338
Walter Avatar asked Aug 18 '14 13:08

Walter


1 Answers

It looks like a known issue. Try compiling with -fext-numeric-literals.

like image 90
Cornstalks Avatar answered Oct 17 '22 00:10

Cornstalks