Monday, August 8, 2011

Chapter 3, question 1

1.  What's the difference between an integer variable and a floating-point variable?

A floating-point can store a fractional component; an integer cannot.
A floating-point is always signed; an integer may be unsigned or signed.
A floating-point generally has an upper/lower range that is much larger in magnitude than that of integers.
A floating-point number operation can suffer from rounding and imprecision errors.  An integer operation is always exact (assuming there is no overflow error or type mismatch).

No comments:

Post a Comment