Freigeben über


2.2.26 DECIMAL

The DECIMAL structure specifies a sign and scale for a number. Decimal variables are represented as 96-bit unsigned integers that are scaled by a variable power of 10.

 typedef struct tagDEC {
   WORD wReserved;
   BYTE scale;
   BYTE sign;
   ULONG Hi32;
   ULONGLONG Lo64;
 } DECIMAL;

wReserved: MUST be set to 0 and MUST be ignored by the recipient.

scale: MUST be the power of 10 by which to divide the 96-bit integer represented by Hi32 * 2^64 + Lo64. The value MUST be in the range of 0 to 28, inclusive.

Value

Meaning

0 — 28

Order of magnitude of the decimal number.

sign: MUST equal one of the following values.

Value

Meaning

0

The decimal contains a positive value.

0x80

The decimal contains a negative value.

Hi32: MUST be the high 32 bits of the 96-bit integer that is scaled and signed to represent the final DECIMAL value.

Lo64: MUST be the low 64 bits of the 96-bit integer that is scaled and signed to represent the final DECIMAL value.