Re: Decimal versus binary arithmetic was Re: J4 - presentation/discussion on "Future of the COBOL Standard"
- From: "tlmfru" <lacey@xxxxxxx>
- Date: Tue, 1 Apr 2008 14:05:50 -0600
Clark F Morris <cfmpublic@xxxxxxxxxxxxxxx> wrote in message
news:if05v3503beg04nonbeci3n8eqo2vill79@xxxxxxxxxx
On Mon, 31 Mar 2008 22:37:12 -0600, Robert <no@xxxxxx> wrote:<cfmpublic@xxxxxxxxxxxxxxx> wrote:
On Mon, 31 Mar 2008 21:55:10 -0300, Clark F Morris
talk about 'binary
On Tue, 18 Mar 2008 19:34:51 -0600, Robert <no@xxxxxx> wrote:
Lots of muddled thinking on numeric errors has been published. Some
point. Here's anarithmetic' without making a distinction between integer and floating
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.
He's right, you know.
0.2 (decimal) in binary = 1/8 + 1/16 + 1/128 + 1/256 ... = .00110011 ... =
0.19921875. etc. Obviously binary division is done by black magic
involving shifts & counts.
PL
.
- Follow-Ups:
- References:
- Decimal versus binary arithmetic was Re: J4 - presentation/discussion on "Future of the COBOL Standard"
- From: Clark F Morris
- Re: Decimal versus binary arithmetic was Re: J4 - presentation/discussion on "Future of the COBOL Standard"
- From: Robert
- Re: Decimal versus binary arithmetic was Re: J4 - presentation/discussion on "Future of the COBOL Standard"
- From: Clark F Morris
- Decimal versus binary arithmetic was Re: J4 - presentation/discussion on "Future of the COBOL Standard"
- Prev by Date: Re: Decimal versus binary arithmetic was Re: J4 - presentation/discussion on "Future of the COBOL Standard"
- Next by Date: Re: Did I write a good (efficient) program?
- Previous by thread: Re: Decimal versus binary arithmetic was Re: J4 - presentation/discussion on "Future of the COBOL Standard"
- Next by thread: Re: Decimal versus binary arithmetic was Re: J4 - presentation/discussion on "Future of the COBOL Standard"
- Index(es):
Relevant Pages
|
Loading