From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,7cda96e9413b780c X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-07-18 07:15:40 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!opentransit.net!wanadoo.fr!teaser.fr!freenix!enst.fr!not-for-mail From: "Robert C. Leif" Newsgroups: comp.lang.ada Subject: RE: Floating Decimal Package/Library? Date: Thu, 18 Jul 2002 07:13:18 -0700 Organization: ENST, France Sender: comp.lang.ada-admin@ada.eu.org Message-ID: Reply-To: comp.lang.ada@ada.eu.org NNTP-Posting-Host: marvin.enst.fr Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: avanie.enst.fr 1027001740 45454 137.194.161.2 (18 Jul 2002 14:15:40 GMT) X-Complaints-To: usenet@enst.fr NNTP-Posting-Date: Thu, 18 Jul 2002 14:15:40 +0000 (UTC) Return-Path: X-Envelope-From: rleif@rleif.com X-Envelope-To: X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.3416 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Importance: Normal In-Reply-To: Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: comp.lang.ada mail<->news gateway List-Unsubscribe: , Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org Xref: archiver1.google.com comp.lang.ada:27225 Date: 2002-07-18T07:13:18-07:00 From: Bob Leif To: Waldek Hebisch et al. The point is NOT speed but is accuracy and understandability. Our arithmetic education is based on decimals. Fixed point types including decimal types have the problem of not being able to create a type with an exponent (delta) value calculated at run-time. Either a user formula or a default to the equivalent of floating point could be used for calculating the value of the exponent. This probably is a pain for the compiler writers. However, one of the virtues of Ada is that the compiler writers work to ease the developers' work. A simple example of the use of a floating decimal type is spreadsheets, which should be based on type decimal. -----Original Message----- From: comp.lang.ada-admin@ada.eu.org [mailto:comp.lang.ada-admin@ada.eu.org] On Behalf Of Waldek Hebisch Sent: Wednesday, July 17, 2002 2:56 PM To: comp.lang.ada@ada.eu.org Subject: Re: Floating Decimal Package/Library? Warren W. Gay VE3WWG (ve3wwg@cogeco.ca) wrote: : Since the PostgreSQL group have expressed no : interest in supporting floating decimal : routines for the client, I wonder if anyone : in these groups know of an Ada package (preferred), : or C/C++ library that supports arbitrary : prcecision floating decimal values. I could : hack the PostgreSQL back end C routines, but : this may not be practical. : The GNU GMP library comes close, but its : floating support library uses binary : arithmetic (this is a no-no for financial : work). I've suggested that they augment GMP : with this support, but I'm not sure what : response I'll get to the request. : I am looking for a PD/GPL/Open Sourced work. Well, decimal floating point is an oxymoron: floating point is inherently inaccurate so the representation does not matter. What you want is fixed point arithmetic. Fixed point is not hard to do once you have arbitrary precision integers (for integers again binary versus decimal does not matter). For example Tiny Cobol build all its decimal on top of GMP. One may be concerned with efficency of such implementation, but I think that on binary machines 20-30 digit decimal arithmetic cannot be really fast. -- Waldek Hebisch hebisch@math.uni.wroc.pl or hebisch@hera.math.uni.wroc.pl