Unsigned double in C++?

前端 未结 3 953
醉酒成梦
醉酒成梦 2021-02-01 11:50

Why doesn\'t C++ support unsigned double syntax?

3条回答
  •  [愿得一人]
    2021-02-01 12:34

    Unsigned integers gain an extra bit of precision and have slightly different bit-wise semantics to signed integers. Floats and doubles always reserve a bit for the sign (on most hardware) and have no bit-wise semantics, so there's no real benefit in having an unsigned real type.

提交回复
热议问题