Question: Write a small library in the C programming language to do Minifloat (Links to an external site.) (8-bit binary floating-point numbers) operations. Notes You have
Write a small library in the C programming language to do Minifloat (Links to an external site.) (8-bit binary floating-point numbers) operations.
Notes
- You have to come up with a sensible representation and stay consistent throughout a library.
- The internal representation (e.g. a struct) does not have to match the external representation (e.g. just a binary pattern, or a pointer to an abstract data type).
- Be careful of memory leaks. For example, do not return a pointer to a local static variables in a function. Instead, allocate on the heap with malloc and then return the pointer to that.
Minimum requirements
Meeting these requirements will collect the regular points.
- add - Add two Minifloat numbers and return the result.
- mult - Multiply two Minifloat numbers and return the result.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
