ILE C/C++ Programmer's Guide


Using BCD Macros to Port Coded Decimal Objects to ILE C++

The Binary Coded Decimal Class Library for OS/400 is provided so that you can create binary coded decimal objects that are compatible with the ILE packed decimal data types.

The macros shown in the following figure are used by the _DecimalT class template to maintain compatibility with ILE C:

Figure 212. BCD Macros that Port Code from ILE C to ILE C++



#define decimal _Decimal
#define digitsof __digitsof
#define precisionof __precisionof
#define _Decimal(n,p) _DecimalT<n,p>
#define __digitsof(DecName) (DecName).DigitsOf()
#define __precisionof(DecName) (DecName).PrecisionOf()


[ Top of Page | Previous Page | Next Page | Table of Contents ]