views:

75

answers:

4

Why is it important to assume that integers in our computer model have a fixed size?

A: 

To account for overflow errors.

omgzor
A: 

Do you mean 'assume' or 'know' ?

By the fact that they are fixed size, they are limited to the quantities that they can store. Are you storing a count greater than 65,535 (unsigned 2-byte short), or the population of the Earth (6 billion - greater than a 4-byte unsigned int can store). What you're trying to model will dictate what size of datatype you use.

You can use objects that aren't fixed-size (e.g. BigInteger in Java). The downside is that performance will suffer to some degree.

Brian Agnew
A: 

Because in computer math, a+1 < a can be true!

If a is a signed one-byte twos-complement value, it can store numbers from -256 to 255. If a=255, then a+1=-256.

Borealid
Actually, that's -128 to 127, or 0 to 255 if unsigned.
Chris
A: 

An address have a fixed size which is determined by the Operating System and that's an integer number.

Lajos Arpad