|
楼主 |
发表于 2010-9-13 09:46:31
|
显示全部楼层
ublic Function result(ByVal b1, b2, b3, b4 As Byte) As Single
Dim E As Integer '
Dim weishu As Long
Dim BX1, BX2 As Byte
Dim E2 As Double
E2 = 1
If b1 = 0 Then
result = 0
Else
If b1 > &H80 Then
BX1 = b1 - &H80
Else
BX1 = b1
End If
E = BX1 * 2
If (b2 - &H80) < 0 Then
BX2 = b2 + &H80
Else
BX2 = b2
E = E + 1
End If
E = E - 127 - 23
weishu = CLng(BX2) * 256 * 256 + CLng(b3) * 256 + CLng(b4)
E2 = 2 ^ E
result = CSng(CSng(weishu * E2))
If b1 - &H80 > 0 Then
result = 0 - result
End If
End If
End Function |
|