From: Damian Yerrick Newsgroups: comp.os.msdos.djgpp Subject: Re: long double Organization: Pin Eight Software http://pineight.8m.com/ Message-ID: <95ombs4heb76s5jq0bngf2h9an0k00fq3r@4ax.com> References: <20000228191050 DOT 1840 DOT qmail AT web2203 DOT mail DOT yahoo DOT com> <83bt5156ke DOT fsf AT mercury DOT st DOT hmc DOT edu> X-Newsreader: Forte Agent 1.7/32.534 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Lines: 50 X-Trace: +4Lrtsz+SVc2otIxGfPlV5d/9DV9ospXSGUFqJ2ZHLVWAs1L5q5mhdgjCn9neGpBrhNf4r7gGAxs!3HocOUz7lJ/pOc+zeTUsocUUMjENbKNNOfspqYs7x4H0xCP4pUXL7WBiJY8H0yjDRVhX2Z2kv+pc!eg== X-Complaints-To: abuse AT gte DOT net X-Abuse-Info: Please be sure to forward a copy of ALL headers X-Abuse-Info: Otherwise we will be unable to process your complaint properly NNTP-Posting-Date: Tue, 29 Feb 2000 06:05:45 GMT Distribution: world Date: Tue, 29 Feb 2000 06:05:45 GMT To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com On 28 Feb 2000 14:02:41 -0800, Nate Eldredge 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 #include #include 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/