Why doesn't C have unsigned floats?

后端 未结 12 1678
名媛妹妹
名媛妹妹 2020-11-28 01:47

I know, the question seems to be strange. Programmers sometimes think too much. Please read on...

In C I use signed and unsigned integers a

12条回答
  •  天命终不由人
    2020-11-28 02:27

    I guess it depends on that the IEEE floating-point specifications only are signed and that most programming languages use them.

    Wikipedia article on IEEE-754 floating-point numbers

    Edit: Also, as noted by others, most hardware does not support non-negative floats, so the normal kind of floats are more efficient to do since there is hardware support.

提交回复
热议问题