单精度浮点格式范围 [英] Single-precision floating-point format Range

查看:85
本文介绍了单精度浮点格式范围的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

符号= 1位,偏置指数= 8位,尾数= 23位

Sign = 1 bit, Biased Exponent = 8 bits, Mantissa = 23 bits

正负可能范围是多少?我的老师告诉我ieee 754的范围如下:

What is the positive and negative possible range? My teacher told me the following range for ieee 754:

-0.5*2^-128 to -(1-2^-24)*2^127 (for negative floating point numbers)

0.5*2^-128 to (1-2^-24)*2^127 (for positive floating point numbers)

但是我发现此范围不正确,因为我无法理解如何将0.5 * 2 -128 存储为这种格式.请解释.

But I don't find this range correct because I am not able to understand how to store 0.5 * 2-128 into this format. Please explain.

推荐答案

首先,浮点数格式对于正数和负数是对称的.所以我们只看积极的情况.

Firstly, the floating-point number format is symmetric for positive and negative numbers. So we will only look at the positive case.

最大正数具有最大尾数1.11111111111111111111111111 2 和最大非无限指数127.因此1.11111111111111111111111111 2 ×2 127 =( 2 − 2 −23 )×2 127 ≈3.402×10 38 ≈2 128 .

The maximum positive number has the maximum mantissa 1.111111111111111111111112 and maximum non-infinite exponent 127. Thus 1.111111111111111111111112 × 2127 = (2 − 2−23) × 2127 ≈ 3.402 × 1038 ≈ 2128.

最小正数的尾数为非零,为0.00000000000000000000001 2 ,对于次正规/非规格化数,最小指数为-126.因此0.00000000000000000000001 2 ×2 −126 = 2 -23 ×2 −126 = 2 −149 ≈1.401×10 −45 .

The minimum positive number has the non-zero mantissa 0.000000000000000000000012 and the minimum exponent −126 for subnormal/denormalized numbers. Thus 0.000000000000000000000012 × 2−126 = 2−23 × 2−126 = 2−149 ≈ 1.401 × 10−45.

进一步阅读: https://en.wikipedia.org/wiki/Single-precision_floating -point_format

这篇关于单精度浮点格式范围的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆