This project has to do with the representation and manipulation of floating point numbers in a computer. You are required to develop a computer program, using the ANSI C programming language, that will accept as input the following:
1. A value representing the base of the numbers that shall be used within the program; for example, if 10 is that value, then the numbers to be used in the program shall be of the form 12.3 and 34.565
2. Two floating point numbers that are in the base entered above; for example, if the base is 2, then the floating point numbers may be 11.0101 and 1010.011
3. One operator from among +, -, * and /
Further, you are to create appropriate structures for all of the entities/constructs used in the manipulations in the program.
In addition, the floating point numbers must be captured in a structure that stores at least two elements, one of which will be an exponent and the other a mantissa. For example, if base 10 is used then 2.5 shall be expressed as having a mantissa of 25 and an exponent of -1. This essentially converts the real number into two integers which are amenable to storage in a computer’s memory.
Your assignment is to develop a calculator that makes use of the above in addition to your own constructs. As basic requirement, your program must accept numbers in base 2; but for a maximum of 10% bonus marks, you can implement functions to allow the program to accept and operate on numbers in one other base e.g. base 8 or base 16. Please ensure that you pay requisite attention to (1) appropriate choices regarding data types, (2) efficiency both in terms of memory and processing time, and (3) the elegance of your program.