单精度浮点数转换十进制数据
function getFloat (dataL, dataH) {
const intSign = Math.floor(dataL / 32768)
const intSignRest = Math.floor(dataL % 32768)
const intExponent = Math.floor(intSignRest / 128)
const intExponentRest = intSignRest % 128
const faDigit = (intExponentRest * 65536 + dataH) / 8388608
return Math.pow(-1, intSign) * Math.pow(2, intExponent - 127) * (faDigit + 1)
}
评论区