Unsigned double in C++?

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

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

3条回答
  •  孤城傲影
    2021-02-01 12:41

    Because typical floating point formats don't support unsigned numbers. See, for instance, this list of IEEE 754 formats.

    Adding a numerical format that isn't supported by common hardware just makes life difficult for compiler writers, and is probably not considered worth the effort.

提交回复
热议问题