Question: Write in C# only! write a program which correctly calculates add, subtract, multiply and divide for our minifloat binary format using an algorithm you code

Write in C# only!

write a program which correctly calculates add, subtract, multiply and divide for our minifloat binary format using an algorithm you code yourself. Some details: Your program only needs to work on two numbers at a time. For each number store the sign, exponent and mantissa separately.

E.g. Struct miniflaot{ Int sign; // sign, actually 1 bit Int exponent; // this is the exponent and is 4 bits long (0-15) Int mantissa; //this is the fraction part and is 3bits long (0-7), but I would keep the 1. Stored explicitly, so it becomes 0-15 and 4 digits long. }

Show testing for all 4 (add, sub, mul, div). Make sure you are error checking for NAN and +/- 0.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!