From: "Mr. Veli Suorsa" Sender: vjsuorsa AT Surfeu DOT Fi To: djgpp AT delorie DOT com Cc: Hans-Bernhard Broeker , VJSuorsa AT Surfeu DOT Fi Date: Fri, 2 Mar 2001 13:48:35 +0200 Subject: Re: Fortran / C compiler precision and code pack X-Mailer: CWMail Web to Mail Gateway 2.6k, http://netwinsite.com/top_mail.htm Message-id: <3a9f8893.7d7b.0@surfeu.fi> X-User-Info: 193.167.106.194 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Reply-To: djgpp AT delorie DOT com Thanks for your e-mail. >>>If your problem is with 14.399996 being printed instead of 14.4, >>>that's normal: REAL variables only have about 6.5 digits of >>>precision. Try using DOUBLE PRECISION instead. > >> Thanks, it seems to be ok. >> But was it a bug, I have newer seen before in my long life? > >It was not so much a bug, but a an error in your >expectation about the program's behaviour. You'ld have >to learn a bit more about Fortran to see how to get >the behaviour you expected. And a bit more about It was just a test from book and numbers differ from typed. That is why I asked it. >numerical computation in general to see why doing this >kind of stuff with a datatype like REAL is a bad idea --- >professional software of this type would usually count >pennies (or even fractions of pennies), not pounds, >and store everything in INTEGER or even INTEGER*8 >variables. I have use about 17,5 years marks (not pennies), pounds (not pennies) and dollars (not cents) for counting salary or payment (and real or higher precision) in databases. Where are these "pennies from heaven" professionals, that I can change some experience with them? >-- >Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de) >Even if all the snow were burnt, ashes would remain. P.S Where is yours remaining ashes ;-)? Thank you! Veli Suorsa --- Oulu, FINLAND Mailto:VJSuorsa AT Surfeu DOT Fi http://members.surfeu.fi/veli.suorsa/ http://www.surfeu.fi