sleepingSatellite
Programmer
FORTRAN introduces small errors handling real numbers, even in the most simple operations.
For example running the following program:
Program try
Real a,b
a=2.555
b=3-a
write (*,100)'a=',a
write (*,100)'c=',b
100 format(A2,E16.10E2)
End program try
one gets the following results:
a=0.2555000100E+01
c=0.4449999300E+00
I'm certainly not the first to discover this.
I'd like to know how people usually put up with this.
Is there anything I can do to avoid it?
Or should I resign to compromise with it ?
Thank you in advance
For example running the following program:
Program try
Real a,b
a=2.555
b=3-a
write (*,100)'a=',a
write (*,100)'c=',b
100 format(A2,E16.10E2)
End program try
one gets the following results:
a=0.2555000100E+01
c=0.4449999300E+00
I'm certainly not the first to discover this.
I'd like to know how people usually put up with this.
Is there anything I can do to avoid it?
Or should I resign to compromise with it ?
Thank you in advance