十六进制数转换成浮点数怎么转换?其中的原理是什么?
我想了解更深层次的原理,用笔算也能算出来。VB怎么通过代码实现16进制转化为浮点数呢???
Type Ltype l As Long End Type Type Ftype f As Single End Type Public Function HEXtoSingle(H As String) As Single Dim s As String '中间变量 Dim l As Ltype '二个是lset命令要求的参数格式 Dim f As Ftype s = "&H" & H '生成中间变量 l.l = Val(s) '转十进制 LSet f = l '把整数复制到浮点数中 HEXtoSingle = f.f '返回该代码对应的浮点数 End Function