Strange results occurring with the attached piece of code. The CalcPerecntDotNet method is returning mixed results when you divide 100 by the following numbers 13 thru 15, 17 thru 19, 21 thru 24. FYI, I stopped testing at 100. The CalcPercentCobol method seems to work correctly. Also it should be noted that the piece of code that is causing the problem is when I try to move the Decimal field to the Pic 9(03)v99 field using the set command.
Below I provided the values 13 thru 24
passed value | CalcPercentCobol | CalcPercentDotNet | ||||
13 | 7.69 | 707.54 | ||||
14 | 7.14 | 706.99 | ||||
15 | 6.66 | 706.51 | ||||
16 | 6.25 | 6.25 | ||||
17 | 5.88 | 705.73 | ||||
18 | 5.55 | 705.4 | ||||
19 | 5.26 | 705.11 | ||||
20 | 5 | 5 | ||||
21 | 4.76 | 704.61 | ||||
22 | 4.54 | 704.39 | ||||
23 | 4.34 | 704.19 | ||||
24 | 4.16 | 704.01 |