next up previous contents
Next: Control Constructs Up: More About Operations Previous: Cost of Arithmetic Operators

 

Precision Errors

Since real numbers are stored approximately:

Consider,

   x = 0.123456; y = 0.123446
   PRINT*, "x = ",x," y = ",y
   PRINT*, "x-y = ",x-y," should be 0.100d-4"

May produce:

   x = 0.123457  y = 0.123445
   x-y = 0.130d-4 should be 0.100d-4

which is 30% in error.

A whole branch of Numerical Analysis is dedicated to minimising this class of errors in algorithms. Be careful!

For more information, click here gif


next up previous contents
Next: Control Constructs Up: More About Operations Previous: Cost of Arithmetic Operators

©University of Liverpool, 1997
Wed May 28 23:37:18 BST 1997
Not for commercial use.