HP aC++/HP C A.06.20 Release Notes

example, 123.00 + 45.6 = 168.60 and 123.00 * 0.01 = 1.2300. These special quantum
semantics facilitate exact fix-point calculation. For typical floating-point calculations,
the quantum semantics can be ignored.
Decimal FP support includes the following:
Three built-in decimal FP types:
_Decimal32 _Decimal64 _Decimal128
with 7, 16, and 34 decimal digits of precision, respectively.
The usual built-in arithmetic operators for decimal FP operands: +, , *, /,
assignments, comparisons, and conversions with integer and binary FP types, all
with correctly-rounded IEEE arithmetic. An operation may combine a decimal FP
operand with an operand of a different decimal FP type or with an integer type.
However, mixing operands of decimal and binary FP types is not allowed.
60 math functions for each decimal FP type. Function suffixes are d32 for
_Decimal32, d64 for _Decimal64, and d128 for _Decimal128. Included are:
Decimal FP versions of the C99 math functions.
New functions to manage quantum exponents (for fixed-point calculation).
Routines to encode and decode data for either of the two standard encodings
for decimal FP data. Details of the encodings are in the draft revision of IEEE
754, which refers to them as the "binary encoding", which the HP C/aC++
compiler uses, and the "decimal encoding". Both encodings provide exactly the
same data, analogous to big endian and little endian encodings.
Decimal FP I/O and string conversion. The decimal FP length modifiers for
printf() and scanf() floating-point conversion specifiers (a, A, e, E, f, F, g, G)
are H for _Decimal32, D for _Decimal64, and DD for _Decimal128. The decimal a,
A specifiers for printf(), given no precision or sufficient precision, produce an
exact quantum-preserving representation of the decimal FP value being converted.
WDB debugger support for printing values of decimal FP types.
Suffixes to designate decimal floating constants: df or DF for _Decimal32, dd or
DD for _Decimal64, and dl or DL for _Decimal128. Note that an unsuffixed floating
constant still has type double, regardless of the context. Explicit suffixing with a
d or D to specify type double is also allowed.
Decimal FP versions of macros in <float.h>, <math.h>, and <fenv.h>.
Five rounding modes for decimal FP: to nearest with ties to even, to nearest with
ties away from zero, upward, downward, and toward zero.
Compiler option +decfp, which enables full decimal FP functionality according
to the ISO/IEC C draft Technical Report: http://www.open-std.org/jtc1/
sc22/wg14/www/docs/n1312.pdf
Compiler option -fpevaldec=precision, which specifies the minimum
precision to use for decimal floating-point expression evaluation. The possible
values for precision are _Decimal32, _Decimal64, and _Decimal128. This
10 What’s New in This Version