Code Comments
Programming Forum and web based access to our favorite programming groups.On Tue, 01 Apr 2008 19:29:05 -0300 Clark F Morris <cfmpublic@ns.sympatico.ca > wrote: :>On Tue, 1 Apr 2008 13:14:46 -0600, "Frank Swarbrick" :><Frank.Swarbrick@efirstbank.com> wrote: :>>>>> On 4/1/2008 at 12:43 PM, in message :>><if05v3503beg04nonbeci3n8eqo2vill79@4ax.com>, Clark F :>>Morris<cfmpublic@ns.sympatico.ca> wrote: :>>> On Mon, 31 Mar 2008 22:37:12 -0600, Robert <no@e.mail> wrote: :>>>>On Mon, 31 Mar 2008 21:55:10 -0300, Clark F Morris :>>><cfmpublic@ns.sympatico.ca> wrote: :>>>>>On Tue, 18 Mar 2008 19:34:51 -0600, Robert <no@e.mail> wrote: :>>>>>>Lots of muddled thinking on numeric errors has been published. Some t alk :>>> about 'binary :>>>>>>arithmetic' without making a distinction between integer and floating :>>> point. Here's an :>>>>>>example: :>>>>>Try doing a simple divide like calculate the value of 1 / 5 in binary. :>>>>OK. :>>>>01 numerator value 1 binary pic 9(9). :>>>>01 denominator value 5 binary pic 9(9). :>>>>01 quotient binary pic 9(9)v9(4). :>>>>compute quotient = numerator / denominator :>>>>display quotient :>>>>0000000002000 :>>>>>You get a never ending fraction. :>>>>Looks pretty diadic to me. :>>> You may have to do this in Assembler to get the results that I am :>>> talking about. Take a look at the generated instructions. If I had :>>> access to an IBM mainframe I would compile a small test program to see :>>> what the underlying code is. :>>5820 9510 L 2,1296(0,9) NUMERATOR :>>4E20 D1C4 CVD 2,452(0,13) TS2=4 :>>D203 D1C0 C02A MVC 448(4,13),42(12) TS2=0 :>> SYSLIT AT +42 :>>F060 D1C5 0004 SRP 453(7,13),4(0),0 TS2=5 :>>5820 9518 L 2,1304(0,9) DENOMINATOR :>>4E20 D1D0 CVD 2,464(0,13) TS2=16 :>>FDB4 D1C0 D1D3 DP 448(12,13),467(5,13) TS2=0 :>> TS2=19 :>>F896 D1E0 D1C0 ZAP 480(10,13),448(7,13) TS2=32 :>> TS2=0 :>>960F D1E9 OI 489(13),X'0F' TS2=41 :>>D202 D1D8 C02A MVC 472(3,13),42(12) TS2=24 :>> SYSLIT AT +42 :>>D204 D1DB D1E5 MVC 475(5,13),485(13) TS2=27 :>> TS2=37 :>>4F20 D1D8 CVB 2,472(0,13) TS2=24 :>>F144 D1DB D1E0 MVO 475(5,13),480(5,13) TS2=27 :>> TS2=32 :>>4F50 D1D8 CVB 5,472(0,13) TS2=24 :>>5C40 C004 M 4,4(0,12) SYSLIT AT +4 :>>1E52 ALR 5,2 :>>58B0 C034 L 11,52(0,12) PBL=1 :>>47C0 B698 BC 12,1688(0,11) GN=16(000A70) :>>5A40 C000 A 4,0(0,12) SYSLIT AT +0 :>> GN=16 EQU * :>>1222 LTR 2,2 :>>47B0 B6A2 BC 11,1698(0,11) GN=17(000A7A) :>>5B40 C000 S 4,0(0,12) SYSLIT AT +0 :>> GN=17 EQU * :>>9045 9520 STM 4,5,1312(9) QUOTIENT :>Wow, they are actually doing this in decimal. I wonder what the code :>would be like using binary instructions. I see they are handling the :>remainder separately. I would guess the conversions are being done to properly handle the differen t scaling factors, where decimal arithmetic can handle larger precisions (fullword is limited to 10 digits while packed can hold 15 digits - and with Z hardware, the numbers double). Try them all with the same picture, 9(4)V4(9), which will fit in a word. -- Binyamin Dissen <bdissen@dissensoftware.com> http://www.dissensoftware.com Director, Dissen Software, Bar & Grill - Israel Should you use the mailblocks package and expect a response from me, you should preauthorize the dissensoftware.com domain. I very rarely bother responding to challenge/response systems, especially those from irresponsible companies.
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.