Return the 32‐bit decimal value closest to an unsigned 64‐bit integer.

Synopsis

Declared in <bdldfp_decimalimputil_inteldfp.h>

static
DecimalImpUtil_IntelDfp::ValueType32
uint64ToDecimal32(unsigned long long value);

Description

Return a Decimal32 object having the value closest to the specified value following the conversion rules as defined by IEEE‐754:

* If value is zero then initialize this object to a zero with an unspecified sign and an unspecified exponent. * Otherwise if value has a value that is not exactly representable using std::numeric_limits<Decimal32>::max_digit decimal digits then return the value rounded according to the rounding direction. * Otherwise initialize this object to the value of the value.

The exponent 0 (quantum 1e‐6) is preferred during conversion unless it would cause unnecessary loss of precision.

Return Value

closest 32‐bit decimal representation of value

Parameters

Name

Description

value

unsigned 64‐bit integer value to convert

Created with MrDocs