This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GCC's Decimal Floating Point extension problem


Â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ÂÂÂÂÂÂÂÂ


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]