GuyC
Senior Member
Joined: 11 Aug 2009 Posts: 1281 Location: Belgium
|
|
|
|
It is a very consistent result when you round each intermediate result :
do this :
R1 = (F-A-B-C-D-E) / (F-A)
R2 = R1 * G
R3 = R2 + H
R3'=round(R3,4)
=> this will give you your 'expected-by-you'-result
do this :
S1 = (F-A-B-C-D-E) / (F-A)
S1' = ROUND(S1,4)
s2 = S1' * G
S2' = round(S2,4)
S3 = S2' + H
==> this will give you your COBOL-result
depending on your compiler : sometimes it is round(intermediate,4) sometimes it is truncate(intermediate,4) |
|