Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

  1. You have to come up with a sensible representation and stay consistent throughout a library.
  2. 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).
  3. 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.

  1. add - Add two Minifloat numbers and return the result.
  2. mult - Multiply two Minifloat numbers and return the result.

Bonus requirements

Meeting these requirements will collect 500 extra points.

  1. Abstract data type (Links to an external site.) with proper header and source files.
  2. sub - Subtract two Minifloat numbers and return the result.
  3. div - Divide two Minifloat numbers and return the result.
  4. Input checking and rejection of out-of-bounds or improperly formatted Minifloat numbers by returning predefined special values. These values should be declared as constants in the header file.

Submission

Submit your code files:

  1. minifloat.h (required for bonus)
  2. minifloat.c (optional for minimum)
  3. test.c (required).

The last file contains a main function which runs at least two tests (with different operands) for each operation or feature (e.g. handling of improper input values) defined.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Expert Oracle9i Database Administration

Authors: Sam R. Alapati

1st Edition

1590590228, 978-1590590225

More Books

Students also viewed these Databases questions

Question

1. What might have led to the misinformation?

Answered: 1 week ago

Question

How do Excel Pivot Tables handle data from non OLAP databases?

Answered: 1 week ago