[英]Converting IEEE754 to custom floating point representation
Just looking for suggestions, how should the IEEE754 single precision floating point representation ie the following: 仅寻找建议, IEEE754单精度浮点表示应如何,即以下内容:
-1 sign ∗ 2 exponent-127 ∗ 1.mantissa 2 -1 号 ∗ 2 指数-127 ∗ 1.尾数2
where the hidden bit worth is 1.0 , be accurately and efficiently converted to a custom floating point representation format like the following: 其中隐藏位的价值为1.0 ,可以准确而有效地转换为自定义浮点表示格式,如下所示:
-1 sign ∗ 2 exponent-128 ∗ 0.1mantissa 2 -1 号 ∗ 2 指数 -128 ∗ 0.1尾数2
where the hidden bit worth is 0.5 隐藏的价值为0.5
I do not intend to delegate the work to someone to do this work for me but mostly looking for suggestions on how to do it in the right and most accurate way. 我无意将工作委托给某人来为我完成这项工作,而是主要是寻求有关如何以正确且最准确的方式进行工作的建议。
The bits that represent some value x in the first scheme represent x /4 in the second scheme. 在第一种方案中代表某个值x的位在第二种方案中代表x / 4。 So, clearly, to represent x in the second scheme, one normally increases the exponent by two. 因此,很显然,为了在第二种方案中表示x ,通常将指数增加2。 Then there are just the abnormal cases to deal with: 然后,只有异常情况需要处理:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.