本文介紹了如何將 IEEE-11073 16 位 SFLOAT 轉換為 Java 中的簡單浮點數?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!
問題描述
標題不言自明:如何將 IEEE-11073 16 位 SFLOAT 轉換為 Java 中的簡單浮點數?
The title speaks for itself: How to convert IEEE-11073 16-bit SFLOAT to simple float in Java?
推薦答案
你可以使用位移位.提取符號、指數和尾數并將它們移位,使它們為浮點格式.您可能需要更正 Infinity 和 NaN.
You can use bit shifting. extract the sign, exponent and mantissa and shift these so they are in float format. You may need to correct for Infinity and NaN.
正如@PretiP 的回答所指出的那樣,指數以 10 為底,因此您需要乘以或除以 10 的冪才能得到最終值.
As @PretiP's answer points out the exponent is base 10 so you would need to multiply or divide by a power of 10 to get the final value.
這篇關于如何將 IEEE-11073 16 位 SFLOAT 轉換為 Java 中的簡單浮點數?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!
【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!