Function Windows API Class

CoerceLongToSingle

Coerce a Long (Integer) value into a Single (precision floating-point) value. Return the Single value whose bytes have the same in-memory representation as the Long value vValue. Inverse of the CoerceSingleToLong Function.

Signature (Visual Basic / VBA)

Public Function CoerceLongToSingle( _
    ByVal vValue As Long _
    ) As Single

Code Example

    CoerceLongToSingle(1) = 1.401298E-45
    CoerceLongToSingle(2) = 2.802597E-45
    CoerceLongToSingle(1065353216) = 1
    CoerceLongToSingle(1073741824) = 2

Notes & Version History

Note Similar to but faster than using the MakeLong and CoerceToSingle functions.