Real-World Computer Number Representation

In this chapter we'll discuss what is perhaps the most fundamental basis upon which three-dimensional (3D) graphics pipelines are built: computer representation of numbers, particularly real numbers. While 3D programmers often use the computer representations (approximations) of real numbers successfully without any understanding of how they are implemented, this can lead to subtle bugs and performance problems at inopportune stages in the development of an application. Most basic undergraduate computer architecture books [106] present the basics of integral data types (e.g., int and unsigned int, short, etc. in C/C++), but give only brief introductions to floating-point and other nonintegral number representations. Since the mathematics of 3D graphics are generally real-valued (as we shall see from the ubiquity of R, R 2 , and R 3 in the coming chapters), it is important for anyone in the field to understand the features, limitations, and idiosyncracies of the computer representation of these nonintegral types.