Boost logo

Boost :

From: Richard Kaiser (rk_at_[hidden])
Date: 2004-05-16 12:26:51


I want to ask the boost community if there is interest in a decimal
floating-point class implementing one or more of the decimal
floating-point types that are intended to become part of a future C and
C++ standard.

This class would be a wrapper class around Mike Cowlishaws decNumber C
library. You can take a look at my first preliminary version (it is just
a first try, the design is far from perfect, it is incomplete, its
notation is inconsistent and not according to boost conventions) at

http://www.rkaiser.de/rkaiser/DecFPClass/DecFPClass.html

Most of its operators work as they should do, and most of Mikes
testcases pass successfully. The function
DecimalFloat_Testcases("d:\\cpp.boo\\decnumber\\decnumberclass\\decTest\\")
in my test program test_rk reads all the testcases from Mikes decTest
files and logs each testcase in a file (bcb files were created with
Borland C++Builder 6, gcc with MinGW g++, and msc with MS Visual Studio
.Net). With “grep "###number" *.log” you get the summary lines:

  File abs.decTest_bcb.log: ###number of tests passed=87 failed=2
  File abs.decTest_gcc.log: ###number of tests passed=87 failed=2
  File abs.decTest_msc.log: ###number of tests passed=87 failed=2
  File add.decTest_bcb.log: ###number of tests passed=773 failed=45
  File add.decTest_gcc.log: ###number of tests passed=773 failed=46
  File add.decTest_msc.log: ###number of tests passed=773 failed=45
  ...

If the boost community is interested, if I find enough time, and if
everything works as intended, the resulting classes would be a reference
implementation for the new standard decimal floating point types, or at
least a close one.

Richard Kaiser


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk