This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Q: Long double constant value
- To: help-gcc at gnu dot org
- Subject: Q: Long double constant value
- From: shiva_kb at my-deja dot com
- Date: Thu, 14 Oct 1999 13:41:25 GMT
- Newsgroups: gnu.gcc.help
- Organization: Deja.com - Before you buy.
- Xref: wodc7nx0 gnu.gcc.help:1407
Hello all:
I don't seem to get correct output for long double constant value. I
am using EGCS (v1.1.2, MingW32) compiler version. Here is an example C
code:
#include <stdio.h>
int main(void)
{
long double val2 = 1.5;
printf("Printing byte sizes for constant values: \n");
printf("Double is %d\n", sizeof(12.345));
printf("Long double is %d \n", sizeof(1.5L));
printf("\nPrinting constant values: \n");
printf("Long double: %Lf\n", 1.5L);
// output is -2.000000
printf("\nA double variable: %f\n", val1);
printf("\nA long double variable: %Le\n", val2);
// output is -2.000000e+000
return 0;
}
Thanks in advance for any help,
-- Shiva KB
Sent via Deja.com http://www.deja.com/
Before you buy.