From 7098291937812826555
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,fed4da4ddd62c919,start
X-Google-Attributes: gidf78e5,public
X-Google-ArrivalTime: 1994-12-30 19:44:53 PST
Path: nntp.gmd.de!newsserver.jvnc.net!netnews.upenn.edu!msunews!agate!howland.reston.ans.net!news.sprintlink.net!malgudi.oar.net!witch!dawes!beman
Newsgroups: comp.std.c++
Message-ID: <791@dawes.win.net>
References: <D1pB3B.Eyo@world.std.com>
Reply-To: beman@dawes.win.net (Beman Dawes)
From: beman@dawes.win.net (Beman Dawes)
Date: Sat, 31 Dec 1994 03:44:53 GMT
Subject: Re: Packed Decimal and C++
Lines: 34

 
In article <D1pB3B.Eyo@world.std.com>, Michael Trachtman (miket@world.std.com) writes:
>Will C++ ever have a standard set of types and operations for
>packed decimal based numbers ?

There are no packed decimal proposals pending, so there is
virtually no chance the Standard C++ Library will have such
classes this time around.  There will be another chance in five
years when the standard gets updated. 

>Such a set of types would be useful for writing base 10, arbitrary
>precision, penny accuracy (i.e. no floating point round off errors)
>programs.

Yes, they are very useful for accounting applications.  A proposal
for standardization would have to deal with internationalization
issues, if any. 

>
>The standard would not have to give the implementation.
>It would just give the class declaration together with a sample
>implementation. This would not require new keywords, since it would
>be a class library. However, a compiler vendor would be free
>to implement it internally, and generate high quality assembler
>on those machines that have hardware support for Packed decimal.

Yes, the standard specifices behavior not implementation for
library classes.

It would be a lot easier to get such a packed decimal (or
similar) class standardized in the future if there was "existing
practice".  So consider making such a class widely available with a
reasonable implementation.  If programmers found it useful, it
would give any future standardization proposal a head start.

-- Beman    (beman@dawes.win.net)


