Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Re: Decimal versus binary arithmetic was Re: J4 - presentation/discussion on "Future of the COB
Clark,
Can you try this (slight) variation - and compile

01  numerator value 1 Comp-5 pic 9(9).
01  denominator value 5 Comp-5 pic 9(9).
01  quotient Comp-5 pic 9(9)v9(4).

compute quotient = numerator / denominator
display quotient

My guess is that they would still be doing it in decimal, but this would "fo
rce"
the compiler into knowing the fields were to be truncated/handeld in "true"
binary rather than based on the PIC.

--
Bill Klein
wmklein <at> ix.netcom.com
"tlmfru" <lacey@mts.net> wrote in message
news:SJvIj.51320$097.28239@newsfe21.lga...
>
> Clark F Morris <cfmpublic@ns.sympatico.ca> wrote in message
>  news:if05v3503beg04nonbeci3n8eqo2vill79@
4ax.com... 
> <cfmpublic@ns.sympatico.ca> wrote: 
> talk about 'binary 
> point. Here's an 
>
>
> 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
>
>



Report this thread to moderator Post Follow-up to this message
Old Post
William M. Klein
04-02-08 02:56 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Cobol archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 05:07 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.