Mail Archives: djgpp/2000/02/29/02:24:03
On 28 Feb 2000 14:02:41 -0800, Nate Eldredge <neldredge AT hmc DOT edu>
wrote:
>Basic <_basic AT yahoo DOT com> writes:
>
>> Hi!
>> Does anyone know how to fix this? When multiplying
>> long doubles, the result is always 2. I am using DJGPP
>> 203
Are you printf()ing them with "%Lf"?
>Please post a complete, compilable example that demonstrates this.
>I'm not aware of any such bug.
I don't get a bug either.
----- NextPart: longdbl.c
// C:\SRC\DJBUGS>gcc -Wall longdbl.c -o longdbl.exe
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main(void)
{
int fac1, fac2;
long double ld1, ld2, ldresult;
for(fac1 = 1; fac1 < 10; fac1++)
for(fac2 = 1; fac2 < 10; fac2++)
{
ld1 = fac1;
ld2 = fac2;
ldresult = ld1 * ld2;
printf("%d * %d = %Lf\n", fac1, fac2, ldresult);
}
return 0;
}
// Works as advertised, producing a multiplication table.
--
Damian Yerrick http://yerricde.tripod.com/
Comment on story ideas: http://home1.gte.net/frodo/quickjot.html
AOL is sucks! Find out why: http://anti-aol.org/faqs/aas/
View full sig: http://www.rose-hulman.edu/~yerricde/sig.html
This is McAfee VirusScan. Add these two lines to your .sig to
prevent the spread of .sig viruses. http://www.mcafee.com/
- Raw text -