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: 103376,7cda96e9413b780c X-Google-Attributes: gid103376,public X-Google-Thread: 109fba,7cda96e9413b780c X-Google-Attributes: gid109fba,public X-Google-Thread: 1014db,7cda96e9413b780c X-Google-Attributes: gid1014db,public X-Google-ArrivalTime: 2002-07-15 06:38:23 PST Message-ID: <3D32CF67.9000709@cogeco.ca> From: "Warren W. Gay VE3WWG" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:0.9.4.1) Gecko/20020508 Netscape6/6.2.3 X-Accept-Language: en-us MIME-Version: 1.0 Newsgroups: comp.lang.ada,comp.lang.c,comp.lang.c++ Subject: Re: Floating Decimal Package/Library? References: <3D2F0FAB.3000108@cogeco.ca> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Date: Mon, 15 Jul 2002 09:34:31 -0400 NNTP-Posting-Host: 198.96.47.195 X-Complaints-To: abuse@sympatico.ca X-Trace: news20.bellglobal.com 1026740052 198.96.47.195 (Mon, 15 Jul 2002 09:34:12 EDT) NNTP-Posting-Date: Mon, 15 Jul 2002 09:34:12 EDT Organization: Bell Sympatico Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!cyclone.bc.net!torn!webster!nf1.bellglobal.com!nf2.bellglobal.com!news20.bellglobal.com.POSTED!not-for-mail Xref: archiver1.google.com comp.lang.ada:27107 comp.lang.c:138561 comp.lang.c++:159224 Date: 2002-07-15T09:34:31-04:00 List-Id: Dann Corbit wrote: > "Robert Wessel" wrote in message > news:bea2590e.0207121458.1bf92f6d@posting.google.com... >>"Warren W. Gay VE3WWG" wrote in message > news:<3D2F0FAB.3000108@cogeco.ca>... > >>>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. >>> >>You may be able to find something from here: >> >>http://www2.hursley.ibm.com/decimal/ >> >>The decNumber package looks like it might meet your requirements, >>although I don't know how it's licensed: >> >>http://www.alphaworks.ibm.com/tech/decNumber It is licensed software for a fee, when I checked it last week. Otherwise it looked quite good. > The numeric type of PostgreSQL supports thousands of digits and is decimal > rather than binary. Exactly, just what I was looking for (decimal). But it is available only on the SERVER side. > http://www.postgresql.org/idocs/index.php?datatype.html#DATATYPE-NUMERIC > > Have you tried news:mailing.database.postgresql-novice > ? > > I think you must have never bothered to read the documentation. I have emailed their mailing list to see if they were interested in providing decimal support on the client side, and they said no. Their response was that their code was "server optimized and slow", and that there were no plans to make it available in libpq. > In case that still does not do it for you, there are bazillions of arbitrary > precision packages around. A web search or a gander at the C faq will > reveal a boatload of them. > -- > C-FAQ: http://www.eskimo.com/~scs/C-faq/top.html > "The C-FAQ Book" ISBN 0-201-84519-9 > C.A.P. FAQ: ftp://cap.connx.com/pub/Chess%20Analysis%20Project%20FAQ.htm There are a large number of BINARY arbitrary precision packages -- but I challenge you to find a decimal one. Many support RATIONAL numbers, but not DECIMAL floating point. When doing financial software, you become very interested in DECIMAL calculations. Doing financial calculations in binary floating point means that you are always struggling with the off by one penny problem. Last night, I did manage to extract their server side C code and adapt it. However, if there are better packages available (ie. faster and more complete), I'd be very interersted in hearing about it. TIA, Warren.