当前位置:网站首页>【JVM】JVM表示浮点数
【JVM】JVM表示浮点数
2022-07-28 08:32:00 【檀越剑指大厂】
JVM表示浮点数
浮点数的组成:符号位、指数位、尾数位。
符号位: 占 1 位,表示正负数;
指数位: 占 8 位;
尾数位: 占 23 位。
浮点数的表示:
- 取值: sflag * m * 2(e-127)
- sflag :符号位。 s = 0, sflag = 1; s = 1, sflag = -1
- m : 尾数位。实际占用 23 位,但是根据 e 的取值,有 24 位。当 e 全为 0 时,尾数位附加 0,否则附加 1
- e :指数位。
具体解析:(以 - 5 为例)
内部形式:1 10000001 01000000000000000000000
符号位:s = 1 得出 sflag = -1;
指数位: 二进制为 10000001,得出十进制 e = 129;
尾数位: 二进制为 01000000000000000000000, 得出: m = 20 + 2-2 = 1.25;
最终取值: sflag * m * 2(e-127) = -1 * 1.25 * 2(129 - 127) = -5
边栏推荐
猜你喜欢

Data analysis interview question summary

蓝牙技术|2025年北京充电桩总规模达70万个,聊聊蓝牙与充电桩的不解之缘
![Detailed explanation of MSTP protocol for layer 3 switch configuration [Huawei ENSP experiment]](/img/97/6c3662ef36b02bc42eec95abaa6bc5.png)
Detailed explanation of MSTP protocol for layer 3 switch configuration [Huawei ENSP experiment]

Review the past and know the new MySQL isolation level

【SwinTransformer源码阅读二】Window Attention和Shifted Window Attention部分

公众号简介

js数组去重,id相同对某值相加合并

Bluetooth technology | the total scale of charging piles in Beijing will reach 700000 in 2025. Talk about the indissoluble relationship between Bluetooth and charging piles

5 运算符、表达式和语句

Hyperlink label
随机推荐
The new mode of 3D panoramic display has become the key to breaking the game
The chess robot pinched the finger of a 7-year-old boy, and the pot of a software testing engineer? I smiled.
MDM数据质量应用说明
shell 实现harbor v1/v2的备份/恢复/迁移等功能
2022年起重机司机(限桥式起重机)考试题库及模拟考试
【SwinTransformer源码阅读二】Window Attention和Shifted Window Attention部分
linux初始化mysql时报错 FATAL ERROR: Could not find my-default.cnf
5 运算符、表达式和语句
Dry goods semantic web, Web3.0, Web3, metauniverse, these concepts are still confused? (top)
JSON 文件存储
中国地图省>市>级>区>镇>村5级联动下载【2019和2021】
Linux initializes MySQL with fatal error: could not find my-default.cnf
【leetcode周赛总结】LeetCode第 83场双周赛(7.23)
一款入门神器TensorFlowPlayground
Mobaxtermsession synchronization
How to obtain the subordinate / annotation information of KEGG channel
Hundreds of billions of it operation and maintenance market has come to the era of speaking by "effect"
Post it notes -- 45 {packaging of the uniapp component picker, for data transmission and processing -- Based on the from custom packaging that will be released later}
Vs2015 use dumpbin to view the exported function symbols of the library
Huid learning 7: Hudi and Flink integration