__d128_to_signed_BCD

Purpose

Convert to Signed Binary Coded Decimal.

Converts the lower digits of a 128-bit decimal floating-point value to a Signed Packed Format (packed decimal).

Prototype

void __d128_to_signed_BCD (_Decimal128, _Bool value, unsigned long long *upper, unsigned long long *lower);

Parameters

upper
The address of the variable that will hold the upper digits of the result.
lower
The address of the variable that will hold the lower digits of the result.

Return value

Produces 31 decimal digits followed by a decimal sign in a 128-bit result. Digits to the left are ignored. The higher 16 digits are stored in the parameter upper. The lower 15 digits plus the sign are stored in the parameter lower.

Positive values are given the sign 0xF if value is true and 0xC if value is false.

Negative values are given the sign 0xD.

Usage

You can use the __d128_shift_right function to access the digits to the left.