Mail Archives: djgpp/2001/03/01/08:06:35
>>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
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.
--
Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de)
Even if all the snow were burnt, ashes would remain.
- Raw text -