Link to home
Start Free TrialLog in
Avatar of theroux
theroux

asked on

Strange calculation result in CLIPPER 5

I am using CLIPPER version 5. The following comparasion never equal on a specific condition.

IF Tot1+Tot2+Tot3+Tot4+Tot5 = User_Fonc()
   Process....
 
User_Fonc is a function who add number inputed from the screen, the result is return  at end of the function
RETURN Result     (Numeric value 9999.99)

The problem is if all Tot... = 200.00

and the result of the function were 5 input of 33.33 plus
a last input of 33.35  (total should be 200.00)

The IF condition never satisfied because the function does not give the same answer as the addition of Tot...

Using debug the sum of the Tot.. field = 200.00 and the number out of the function is 200.00.

Why CLIPPER 5 find the two number not equal?

It is working find for any other combinasion of number.
(use 5 X  33.34 and 1 X 33.30 it will work)

Thanks
PS: Old language but this bug just came out recently.

Jacques Theroux
ASKER CERTIFIED SOLUTION
Avatar of mark2150
mark2150

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of theroux
theroux

ASKER

I note MARK2150 average and give 150 point because he made the effort to response to this question but  the answer was not realy good. I try the same situation using NATURAL CICS, COBOL MVS, ASSEMBLER and the result was find every time.  I did not try FORTRAN, FOCUS, BASIC/VISUAL BASIC, I did not have time to try those language.

I used the get around to bypass the bug  but MARK 2150 had a mistake on his IF statement, it should read ">=". MARK2150 should not make affirmation like  he did with NEVER all over the answer. I was more interested to find if a new version of CLIPPER is out and may be solved the problem.

Thanks
Jacques Théroux