Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Cobol > Re: Decimal ver...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 40 of 53 Topic 4077 of 4195
Post > Topic >>

Re: Decimal versus binary arithmetic was Re: J4 - presentation/discussion on "Future of the COBOL Standard"

by "tlmfru" <lacey@[EMAIL PROTECTED] > Apr 5, 2008 at 10:54 AM

Robert <no@[EMAIL PROTECTED]
> wrote in message
news:c2ldv3dtaij23o1d7h2377975e2053k57d@[EMAIL PROTECTED]
> On Fri, 04 Apr 2008 07:50:39 -0600, Howard Brazee <howard@[EMAIL PROTECTED]
>
wrote:
>
> >On Fri, 04 Apr 2008 00:13:23 -0600, Robert <no@[EMAIL PROTECTED]
> wrote:
> >
> >>You thought that because 'everyone knows' binary fractions are
inaccurate. Some refuse to
> >>believe the number is an integer, not a fraction. That was my whole
point -- we could have
> >>been storing currency amounts (dollars/pounds/zlotnys and cents) in
binary all along. We
> >>never needed packed decimal. It was an IBM sales gimmick, and it
worked.
> >


Tip o'the (Hatlo) hat to whoever pointed this out originally -

One very good reason that pure binary representation was not used is that
decimal fractions cannot (generally) be expressed except as a repeating
number in binary.  Examples: 0.2 (decimal) = .00110011 ... (binary).  .12
(decimal) = .000111 etc. (binary).

To make correct arithmetic using only binary possible, it seems to me that
ALL numbers must be implicitly scaled to remove the decimal point.  If
that
is your meaning, Robert, then you haven't made it clear.  Binary fractions
cannot be represented accurately - period.

Incidentally - everybody knows about the simple algoritm to convert base
10
numbers to base 2 - i.e. repeated division by 2 -
I had some fun working out the mirror algorithm to convert decimal
FRACTIONS
to binary fractions.  (Very easy, actually).  (Both algorithms work for
any
base).  But what puzzles me is I've never seen this written up anywhere.
I'm certain that the early developers of computers (or perhaps IBM
research
fellows) must have discovered the algorithm.  Has anyone seen it written
up?

Cheers
PL
 




 53 Posts in Topic:
Re: Decimal versus binary arithmetic was Re: J4 -
"Frank Swarbrick&quo  2008-04-01 13:14:46 
Re: Decimal versus binary arithmetic was Re: J4 - presentation/d
Clark F Morris <cfmpub  2008-04-01 19:29:05 
Re: Decimal versus binary arithmetic was Re: J4 - presentation/d
Binyamin Dissen <posti  2008-04-02 10:18:01 
Re: Decimal versus binary arithmetic was Re: J4 -
Alistair <alistair@[EM  2008-04-05 14:39:44 
Re: Decimal versus binary arithmetic was Re: J4 - presentation/
Robert <no@[EMAIL PROT  2008-04-05 18:46:10 
Re: Decimal versus binary arithmetic was Re: J4 -
Richard <riplin@[EMAIL  2008-04-07 21:53:28 
Re: Decimal versus binary arithmetic was Re: J4 -
Richard <riplin@[EMAIL  2008-04-07 22:09:08 
Re: Decimal versus binary arithmetic was Re: J4 - presentation/
Robert <no@[EMAIL PROT  2008-04-08 22:05:16 
Re: Decimal versus binary arithmetic was Re: J4 - presentation/
"Rick Smith" &l  2008-04-09 10:16:29 
Re: Decimal versus binary arithmetic was Re: J4 -
Richard <riplin@[EMAIL  2008-04-07 22:16:47 
Re: Decimal versus binary arithmetic was Re: J4 - presentation/
Michael Wojcik <mwojci  2008-04-08 16:57:05 
Re: Decimal versus binary arithmetic was Re: J4 -
Richard <riplin@[EMAIL  2008-04-07 22:29:07 
Re: Decimal versus binary arithmetic was Re: J4 - presentation/
Robert <no@[EMAIL PROT  2008-04-08 21:59:07 
Re: Decimal versus binary arithmetic was Re: J4 -
Richard <riplin@[EMAIL  2008-04-07 22:41:07 
Re: Decimal versus binary arithmetic was Re: J4 -
Richard <riplin@[EMAIL  2008-04-07 22:54:32 
Sampling accuracy and everyone being wrong was Re: Decimal vers
Clark F Morris <cfmpub  2008-04-08 10:31:39 
Re: Sampling accuracy and everyone being wrong was Re: Decimal
docdwarf@[EMAIL PROTECTED  2008-04-08 14:48:38 
Re: Decimal versus binary arithmetic was Re: J4 -
Richard <riplin@[EMAIL  2008-04-08 21:41:10 
Re: Decimal versus binary arithmetic was Re: J4 - presentation/
Robert <no@[EMAIL PROT  2008-04-09 19:19:26 
Re: Decimal versus binary arithmetic was Re: J4 -
Richard <riplin@[EMAIL  2008-04-09 18:45:59 
Re: Decimal versus binary arithmetic was Re: J4 -
"Frank Swarbrick&quo  2008-04-03 18:42:16 
Re: Decimal versus binary arithmetic was Re: J4 - presentation/d
Robert <no@[EMAIL PROT  2008-04-04 00:13:23 
Re: Decimal versus binary arithmetic was Re: J4 - presentation/d
"William M. Klein&qu  2008-04-04 05:52:42 
Re: Decimal versus binary arithmetic was Re: J4 - presentation/d
Robert <no@[EMAIL PROT  2008-04-07 22:41:47 
Re: Decimal versus binary arithmetic was Re: J4 - presentation/d
Howard Brazee <howard@  2008-04-04 07:50:39 
Re: Decimal versus binary arithmetic was Re: J4 - presentation/d
Robert <no@[EMAIL PROT  2008-04-04 19:51:24 
Re: Decimal versus binary arithmetic was Re: J4 - presentation/d
docdwarf@[EMAIL PROTECTED  2008-04-05 01:39:33 
Re: Decimal versus binary arithmetic was Re: J4 - presentation/d
Robert <no@[EMAIL PROT  2008-04-04 21:54:44 
Re: Decimal versus binary arithmetic was Re: J4 - presentation/d
docdwarf@[EMAIL PROTECTED  2008-04-06 02:23:46 
Re: Decimal versus binary arithmetic was Re: J4 - presentation/d
Robert <no@[EMAIL PROT  2008-04-07 22:39:38 
Re: Decimal versus binary arithmetic was Re: J4 - presentation/d
Howard Brazee <howard@  2008-04-08 08:47:27 
Re: Decimal versus binary arithmetic was Re: J4 - presentation/d
Robert <no@[EMAIL PROT  2008-04-08 20:39:22 
Re: Decimal versus binary arithmetic was Re: J4 - presentation/d
Howard Brazee <howard@  2008-04-09 07:51:19 
Re: Decimal versus binary arithmetic was Re: J4 - presentation/d
Robert <no@[EMAIL PROT  2008-04-09 20:00:40 
Re: Decimal versus binary arithmetic was Re: J4 - presentation/d
Howard Brazee <howard@  2008-04-10 07:36:17 
Re: Decimal versus binary arithmetic was Re: J4 - presentation/d
Howard Brazee <howard@  2008-04-10 08:53:22 
Re: Decimal versus binary arithmetic was Re: J4 - presentation/d
Howard Brazee <howard@  2008-04-09 07:53:32 
Re: Decimal versus binary arithmetic was Re: J4 - presentation/d
Robert <no@[EMAIL PROT  2008-04-09 19:54:10 
Re: Decimal versus binary arithmetic was Re: J4 - presentation/d
Howard Brazee <howard@  2008-04-07 08:07:32 
Re: Decimal versus binary arithmetic was Re: J4 - presentation/d
"tlmfru" <la  2008-04-05 10:54:00 
Re: Decimal versus binary arithmetic was Re: J4 - presentation/d
Robert <no@[EMAIL PROT  2008-04-05 18:18:13 
Re: Decimal versus binary arithmetic was Re: J4 - presentation/d
"tlmfru" <la  2008-04-07 11:08:23 
Re: Decimal versus binary arithmetic was Re: J4 - presentation/d
Robert <no@[EMAIL PROT  2008-04-07 21:11:04 
Re: Decimal versus binary arithmetic was Re: J4 - presentation/d
"tlmfru" <la  2008-04-08 11:00:52 
Re: Decimal versus binary arithmetic was Re: J4 - presentation/d
Howard Brazee <howard@  2008-04-07 08:09:26 
Re: Decimal versus binary arithmetic was Re: J4 - presentation/d
"tlmfru" <la  2008-04-07 10:49:27 
Re: Decimal versus binary arithmetic was Re: J4 - presentation/d
Howard Brazee <howard@  2008-04-07 08:04:00 
Re: Decimal versus binary arithmetic was Re: J4 - presentation/d
"HeyBub" <he  2008-04-04 08:53:49 
Re: Decimal versus binary arithmetic was Re: J4 - presentation/d
Robert <no@[EMAIL PROT  2008-04-04 21:19:36 
Re: Decimal versus binary arithmetic was Re: J4 - presentation/d
"Pete Dashwood"  2008-04-05 17:34:51 
Re: Decimal versus binary arithmetic was Re: J4 - presentation/d
docdwarf@[EMAIL PROTECTED  2008-04-05 14:03:36 
Re: Decimal versus binary arithmetic was Re: J4 - presentation/d
Howard Brazee <howard@  2008-04-07 08:12:37 
Re: Decimal versus binary arithmetic was Re: J4 - presentation/d
Robert <no@[EMAIL PROT  2008-04-07 20:24:59 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Jul 25 16:33:56 CDT 2008.