Next: Intrinsic Procedures
Up: Mixing Objects of Different
Previous: Mixed Type Assignment
Confusion often arises about integer division; in short,
division of two integers produces an integer result by
truncation (towards zero). Consider,
REAL a, b, c, d, e
a = 1999/1000
b = -1999/1000
c = (1999+1)/1000
d = 1999.0/1000
e = 1999/1000.0
- a is (about) 1.000
- b is (about) -1.000
- c is (about) 2.000
- d is (about) 1.999
- e is (about) 1.999
Great care must be taken when using mixed type arithmetic.
For more information, click here
Now try this question
Next: Intrinsic Procedures
Up: Mixing Objects of Different
Previous: Mixed Type Assignment
Adam Marshall ©University of Liverpool, 1996
Fri Dec 6 18:56:08 GMT 1996Not for commercial use.