For example,
SUBROUTINE DoSomething (Z,L)
IMPLICIT DOUBLE PRECISION (A-H,O-Z)
D=Z*77.1234567D0
L=D
RETURN
END
And for talking purposes, let us assume D is equal to -1.5, would in this case L be equals to -1 or -2. In other words, does it round up or round down?
Thanks in advance.
Conversion to an integer type for assignment follows use of the intrinsic function int. The effect is defined as (F2008 13.7.81)
If A is of type real, there are two cases: if|A|<1, INT(A) has the value 0; if |A| ≥1, INT(A) is the integer whose magnitude is the largest integer that does not exceed the magnitude of A and whose sign is the same as the sign of A.
In this case, then, L will take the value -1.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With