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.
精彩评论