January 2022
Beginner
502 pages
12h 58m
English
We have been using only integral values—integers and characters—in our programs. In this chapter, we’ll look at how computers represent fractional numbers. We’ll look at two ways to represent fraction values, fixed-point and floating-point.
We’ll start by looking at fixed-point numbers, which will show how fractional values are represented in binary. As you will see, the number of bits we use for the integral part of the number limits the range of numbers we can represent. Using some bits for the fractional part simply allows us to divide that range into smaller portions.
This limitation on the range will lead us to ...
Read now
Unlock full access