In ILE C, when you use the __precisionof operator with a
packed decimal data type the result is an integer constant.
The __precisionof operator can be applied to a packed
decimal data type or a packed decimal constant expression. The
__precisionof operator tells you the number of decimal digits
p of the packed decimal data type.
To determine the number of decimal digits p of the packed decimal data, follow the example shown in Figure 219:
#include <decimal.h> int p,p1; decimal (5, 2) x; p=__precisionof(x); /* The result is p=2 */ p1=__precisionof(123.456d); /* The result is p1=3 */ |
In ILE C++, when you use the member function PrecisionOf() with a
_DecimalT class template the result is an integer constant.
The member function PrecisionOf() can be applied to a
_DecimalT class template object. The member function
PrecisionOf() tells you the number of decimal digits p of
the _DecimalT class template object.
To determine the number of decimal digits p of the _DecimalT class template object, follow the example shown in :
#include <bcd.h> int p,p1; _DecimalT <5, 2> x; p=x.PrecisionOf(); // The result is p=2 |
(C) Copyright IBM Corporation 1992, 2005. All Rights Reserved.