I am trying to use __float128in my C ++ program.
However, I am having trouble compiling it.
Here is a simple C ++ code (test.cc):
#include <iostream>
#include <quadmath.h>
using namespace std;
int main(){
__float128 r=0.0q;
__float128 exp_d = expq(12.45q);
cout << "r=" << (double)r << endl;
cout << "exp_d=" << (double)exp_d << endl;
}
And I will compile this code with
g++ test.cc -lquadmath -std=c++11
which comes with the following error
error:unable to find numeric literal operator 'operateor"" q'
How can i fix this?
source
share