使用__float128编译C ++代码 [英] Compiling C++ code using __float128

查看:236
本文介绍了使用__float128编译C ++代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在我的C ++程序中使用 __ float128

I'm trying to use __float128 in my C++ program.

但是我遇到了麻烦

这是简单的c ++代码(test.cc):

Here is 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;
}

然后我用

g ++ test.cc -lquadmath -std = c ++ 11

错误

错误:找不到数字文字运算符'operateor q'

我该如何解决?

推荐答案

Gcc-5打印此有用的附加说明:

Gcc-5 prints this helpful additional note:

note: use -std=gnu++11 or -fext-numeric-literals to enable more built-in suffixes

这篇关于使用__float128编译C ++代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆