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
On Tue, 01 Apr 2008 12:44:49 GMT, "Michael Mattias" <mmattias@talsystems.com
> wrote:

>"Robert" <no@e.mail> wrote in message
> news:jbd3v3tomdipsgke42j5cklujltahbtjle@
4ax.com... 
>
>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.

Nope, all three numbers are binary INTEGERS. The fallacy is in thinking of q
uotient as a
fraction. It is not a fraction, it is an integer.  The compiler SCALED two i
ntegers by
multiplying by powers of 10, then divided two binary integers to get a quoti
ent with no
fraction. Binary 10 divided by binary 5 gives binary 2.

101111101011110000100000000 / 1100001101010000 = 11111010000

For ease of reading,  in base 16 and 10

5F5E100 / C350 = 7D0

100000000   / 50000  = 2000



Report this thread to moderator Post Follow-up to this message
Old Post
Robert
04-02-08 08:57 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 04:58 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.