View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
[email protected] bplumhoff@gmail.com is offline
external usenet poster
 
Posts: 136
Default faster way to convert hex to ieee754?

Hi Mark,

Same approach - just squeezed somewhat (saved 25% runtime on my
engine):
Function Hex2Ieee(b1 As String, b2 As String, _
b3 As String, b4 As String) As Single

Dim bytArray(0 To 3) As Byte
bytArray(3) = "&H" + b1
bytArray(2) = "&H" + b2
bytArray(1) = "&H" + b3
bytArray(0) = "&H" + b4
CopyMemory Hex2Ieee, bytArray(0), 4

End Function

HTH,
Bernd