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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1014db,7cda96e9413b780c X-Google-Attributes: gid1014db,public X-Google-Thread: 109fba,7cda96e9413b780c X-Google-Attributes: gid109fba,public X-Google-Thread: 103376,7cda96e9413b780c X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-07-17 14:56:25 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!newsfeed00.sul.t-online.de!t-online.de!news-lei1.dfn.de!news-fra1.dfn.de!news.man.poznan.pl!pwr.wroc.pl!panorama.wcss.wroc.pl!hebisch From: hebisch@math.uni.wroc.pl (Waldek Hebisch) Newsgroups: comp.lang.ada,comp.lang.c,comp.lang.c++ Subject: Re: Floating Decimal Package/Library? Followup-To: comp.lang.ada,comp.lang.c,comp.lang.c++ Date: 17 Jul 2002 21:56:25 GMT Organization: Politechnika Wroclawska Message-ID: References: <3D2F0FAB.3000108@cogeco.ca> NNTP-Posting-Host: hera.math.uni.wroc.pl X-Trace: panorama.wcss.wroc.pl 1026942985 5149 156.17.86.1 (17 Jul 2002 21:56:25 GMT) X-Complaints-To: abuse@news.pwr.wroc.pl NNTP-Posting-Date: 17 Jul 2002 21:56:25 GMT X-Newsreader: TIN [version 1.2 PL2] Xref: archiver1.google.com comp.lang.ada:27209 comp.lang.c:139090 comp.lang.c++:159666 Date: 2002-07-17T21:56:25+00:00 List-Id: 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