August 2020
Beginner to intermediate
653 pages
16h 55m
English
Your task for Project 2 is to implement a simple fixed-point number class. The class represents fixed-point numbers using an integer type. The number of places after the decimal point is a fixed constant, four. For example, represent the number 3.1415 as the integer 31415 and 3.14 as 31400. You must overload the arithmetic, comparison, and I/O operators to maintain the fixed-point fiction.
Name the class fixed. It should have the following public members:
A type alias for the underlying integer type, such as int or long. By using value_type throughout the fixed ...