Hi All,
I'm trying to write a small program to check the decimal floating point gcc
extension but I encountered some problems
The program just converts a _Decimal64 number to double to print it and I used
the function (double __bid_truncdddf (_Decimal64 a) as the gnu online docs show)
#include <stdio.h>
int main ()
{
_Decimal64 d = 12.5DD;
printf ("%lf\n",__bid_truncdddf(d) );
return 0;
}
$ gcc test.c -Wall -g
test.c: In function ‘main’:
test.c:23: warning: implicit declaration of function ‘__bid_truncdddf’
test.c:23: warning: format ‘%lf’ expects type ‘double’, but argument 2 has type
‘int’
$ ./a.out
0.000000
I don't know why the result is zero and why the second warning appears although
I wrote the function properly!
I'm using gcc version 4.4.3 on ubuntu 10.04
Finally, I suffer from lack of good docs about DFP gcc extension, Does anyone
know a good tutorial explaining the functions and give some examples
Best Regards,
M. Ahmed