开发者

How to include GCC's 128-bit fixed decimal type

I'm on Linux, x86-64 compiling with GCC (11.1) and I'd like to use their 128-bit decimal type:

https://gcc.gnu.org/onlinedocs/gccint开发者_如何学JAVA/Decimal-float-library-routines.html

I found this example:

How to use Decimal64 DPD with gcc

#define __STDC_WANT_DEC_FP__

#include <stdio.h>
#include <string.h>
#include <math.h>

int main () {
  _Decimal64 d = 3.1415DD;
}

and I copied it to get the 64 bit decimal compiling initially before moving to 128 bits.

I added the two suggested GCC flags and exported the environment variable but I get compiler errors:

c++: error: unrecognized command-line option ‘--with-backend=libdecnumber’

when I remove that flag I then get:

cc1plus: error: unknown pass decimal-float specified in ‘-fenable’

Has anyone used these types and able to provide an exhaustive set of instructions for inclusion? There's not much online.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜