Hi everyone,
consider the following code snippet:
ccccccccccccccccccccccccccccccc
integer*4 :: i, j
integer*8 :: k
i = 1000000
j = 2000000
k = i * j
ccccccccccccccccccccccccccccccc
My question is:
Is there any standard how this will be evaluated? Or is this compiler dependent?
I mean, the problem should be clear: if the multiplication is evaluated with 4 byte integers, this will obviously cause overflow. However, the variable to which the result is assigned allows such large numbers.
Any explanation is greatly welcome!
atothep
consider the following code snippet:
ccccccccccccccccccccccccccccccc
integer*4 :: i, j
integer*8 :: k
i = 1000000
j = 2000000
k = i * j
ccccccccccccccccccccccccccccccc
My question is:
Is there any standard how this will be evaluated? Or is this compiler dependent?
I mean, the problem should be clear: if the multiplication is evaluated with 4 byte integers, this will obviously cause overflow. However, the variable to which the result is assigned allows such large numbers.
Any explanation is greatly welcome!
atothep