From 3867297956833183290
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,fed4da4ddd62c919
X-Google-Attributes: gidf78e5,public
X-Google-ArrivalTime: 1995-01-02 22:36:55 PST
Path: nntp.gmd.de!Germany.EU.net!EU.net!news.sprintlink.net!howland.reston.ans.net!news2.near.net!news.delphi.com!crayton
From: crayton@delphi.com (Chris Crayton)
Newsgroups: comp.std.c++
Subject: Re: Packed Decimal and C++
Date: 3 Jan 1995 05:04:26 GMT
Organization: Delphi Internet Services Corporation
Lines: 16
Message-ID: <95010300005913.DLITE.crayton@delphi.com>
References: <ncmD1sxAA.9vD@netcom.com>
NNTP-Posting-Host: bos1f.delphi.com
X-To: Chris Crayton <crayton@delphi.com>

>It is a common misconception that more accurate computation is possible
>in BCD than in binary.  In fact, the only advantage that I know of for
>BCD is that conversion to and from ASCII is quicker.  [Er, and that  
>the Pentium bug doesn't affect you :-)]

Writing in BCD does keep you from getting some roundoff errors that occur
when you change $1.24 into a base 2 representation.  People use BCD in
financial calculations to make sure that the pennies always add up.

Incidentally, Borland C++ has included a bcd type for several years now,
complete with source.

+--------------------+------------------------------------------------+
| crayton@delphi.com | I have come to chew bubble-gum and kick butt,  |
| Team OS/2          | and I'm all out of butt.  -- Crow T. Robot     |



