Which C datatype can represent a 40-bit binary number?

后端 未结 4 1670
说谎
说谎 2020-12-04 02:04

I need to represent a 40-bit binary number. Which C datatype should be used to handle this?

4条回答
  •  时光说笑
    2020-12-04 02:20

    The existing answers are good, but if you want C89 support too, double will be able to store 40-bit integers exactly on all IEEE 754 conformant implementations.

提交回复
热议问题