next up previous contents
Next: Intrinsic Procedures Up: Mixing Objects of Different Previous: Mixed Type Assignment

 

Integer Division

If one integer divides another in a subexpression then type of that subexpression is INTEGER. 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

Now try this question gif

Return to corresponding overview page gif


next up previous contents
Next: Intrinsic Procedures Up: Mixing Objects of Different Previous: Mixed Type Assignment

©University of Liverpool, 1997
Wed May 28 20:20:27 BST 1997
Not for commercial use.