Function Windows API Class

CoerceTwoLongsToDouble

Coerce two Long (Integer) values into a Double (precision floating-point) value. Return the Double value whose low-order double-word (4 bytes) has the same representation as vLo, and whose high-order double-word has the same representation as vHi. Inverse/opposite of the HIDWORD and LODWORD functions.

Signature (Visual Basic / VBA)

Public Function CoerceTwoLongsToDouble( _
      ByVal vLo As Long _
    , ByVal vHi As Long _
    ) As Double

Code Example

    CoerceTwoLongsToDouble(1, 2) = 4.24399158242461E-314
    CoerceTwoLongsToDouble(1, 3) = 6.36598737338988E-314
    CoerceTwoLongsToDouble(3, 1) = 2.12199579244747E-314
    CoerceTwoLongsToDouble(0, 1072693248) = 1
    CoerceTwoLongsToDouble(0, 1073741824) = 2