如何重新present -0二进制 [英] How to represent -0 in binary

查看:132
本文介绍了如何重新present -0二进制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这个问题涉及转换一个浮点数小于ABS(1)和负32.32格式,例如:-0.1234

This question concerns converting a floating point number that is less than abs(1) and negative to 32.32 format, for example: -0.1234.

当此被转换为32.32,整数部分和小数部分分别分离成上和下32位字。另外,在上述本实施例中,上部32位将保持-0,而下将持有0.1234,转换为二进制

When this is converted to 32.32, the integer portion and fractional portion are separated into the upper and lower 32 bit words, respectively. In this example above, the upper 32-bits will hold -0, while the lower will hold .1234, both converted to binary.

所以,问题是,在这种情况下,一个人如何正确地用二进制重新present -0价值?

So the question is, in this case, how does one properly represent the -0 value in binary?

推荐答案

这要看情况。


  • 两补,有没有这样的事情-0。

  • 一补,-0重新$ P $所有'1'psented。

  • 登录幅度,-0重新由符号位psented $ P $的'1',和所有其他位作为0。

  • Two's complement, there is no such thing as -0.
  • One's complement, -0 is represented by all '1's.
  • Sign-magnitude, -0 is represented by a sign bit of '1', and all other bits as '0'.

这篇关于如何重新present -0二进制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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