1 year ago
#76807

Sourav Kannantha B
IEEE integer standard
IEEE 754 defines floating point standards for computers. Is there such a similar standard for integers? Whenever I search for something like that, I end up at IEEE 754!
C/C++ defines char
, short
, int
, long
, long long
as default integral values while Java defines byte
, short
, int
, long
as default integral values. On the other end, Python only gives a single int
as integral type. Some of these, despite having same names, stores different capacities of integers. Looking at this sequence, when/if 128-bit integers arrive, C/C++ may them long long long
.
So, is there a standard (IEEE or any other) integral format which standardizes integers the way there is one for floats?
EDIT: @JohnColeman has some good points in comments. There are some operations on integers like remainder which are ambiguously defined. Here you can see different implementations of modulo operation in different languages. Similarly, there exists a lot of representations for negative numbers. Although 2's complement is popular, nowhere I've heard it is the standard. Even positive numbers have two variants ;) (normal binary and gray code).
floating-point
integer
standards
ieee
0 Answers
Your Answer