For Programmers: Free Programming Magazines  


Home > Archive > Cobol > April 2008 > Re: Decimal versus binary arithmetic was Re: J4 - presentation/discussion on "Fu









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: Decimal versus binary arithmetic was Re: J4 - presentation/discussion on "Fu
Michael Mattias

2008-04-01, 7:55 am

"Robert" <no@e.mail> wrote in message
news:jbd3v3tomdipsgke42j5cklujltahbtjle@
4ax.com...
> On Mon, 31 Mar 2008 21:55:10 -0300, Clark F Morris
> <cfmpublic@ns.sympatico.ca> wrote:
>
>
> 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
>
>
> Looks pretty diadic to me.


That's because you did not do it in binary, you did it in decimal.
One-fifth is rational in decimal, but irrational in binary.



MCM


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com