[#BloombergLP-bdldfp-DecimalImpUtil_IntelDfp-binaryToDecimal64-04] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdldfp.adoc[bdldfp]::xref:BloombergLP/bdldfp/DecimalImpUtil_IntelDfp.adoc[DecimalImpUtil_IntelDfp]::binaryToDecimal64 :relfileprefix: ../../../ :mrdocs: Convert a binary `float` to the closest 64‐bit decimal value. == Synopsis Declared in `<bdldfp_decimalimputil_inteldfp.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static xref:BloombergLP/bdldfp/DecimalImpUtil_IntelDfp/ValueType64.adoc[DecimalImpUtil_IntelDfp::ValueType64] binaryToDecimal64(float value); ---- == Description Create a `Decimal64` object having the value closest to the specified `value` following the conversion rules as defined by IEEE‐754: * If `value` is NaN, return a NaN. * Otherwise if `value` is infinity (positive or negative), then return an object equal to infinity with the same sign. * Otherwise if `value` is a zero value, then return an object equal to zero with the same sign. * Otherwise if `value` needs more than `std::numeric_limits<Decimal64>::max_digit` significant decimal digits to represent then return the `value` rounded according to the rounding direction. * Otherwise return a `Decimal64` object representing `value`. == Return Value closest 64‐bit decimal representation of `value` == Parameters [cols="1,4"] |=== | Name| Description | *value* | binary floating‐point value to convert |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#