BloombergLP::bdldfp::DecimalConvertUtil_IntelDfp::decimalToDPD

Populate buffer with the DPD representation of decimal.

Synopsis

Declared in <bdldfp_decimalconvertutil_inteldfp.h>

static
void
decimalToDPD(
    unsigned char* buffer,
    Decimal32 decimal);

Description

The DPD representations of Decimal32, Decimal64, and Decimal128 require 4, 8, and 16 bytes respectively. The behavior is undefined unless buffer points to a contiguous sequence of at least sizeof(decimal) bytes. Note that the DPD representation is defined in section 3.5 of IEEE 754-2008.

Parameters

NameDescription
bufferreceives the DPD encoding
decimalvalue to encode