This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
GCC's Decimal Floating Point extension problem
- From: Mohamed Abou Samra <my_abousamra at yahoo dot com>
- To: "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Date: Tue, 11 Sep 2012 11:31:39 -0700 (PDT)
- Subject: GCC's Decimal Floating Point extension problem
- References: <1347369620.84017.YahooMailNeo@web125201.mail.ne1.yahoo.com> <1347378308.2369.YahooMailNeo@web125202.mail.ne1.yahoo.com>
- Reply-to: Mohamed Abou Samra <my_abousamra at yahoo dot com>
Â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ÂÂÂÂÂÂÂÂ