Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1) You will develop a library module of C functions which operate on floating point values using only integer operations. The library module will include

1) You will develop a library module of C functions which operate on floating point values using only integer operations. The library module will include the functions listed below:

float get_infinity(); /* Return infinity */

float get_nan(); /* Return not-a-number */

float get_max_normal(); /* Return largest normal */

float get_min_normal(); /* Return smallest normal */

float get_max_denormal(); /* Return largest denormal */

float get_min_denormal(); /* Return smallest denormal */

int is_negative( float ); /* Test if argument is negative */

int is_infinity( float ); /* Test if argument is infinity */

int is_nan( float ); /* Test if argument is not-a-number */

int is_zero( float ); /* Test if argument is zero */

int is_denormal( float ); /* Test if argument is denormal */

float negate( float ); /* Return negation of argument */

float absolute( float ); /* Return absolute value of argument */

The first six functions will return the specified single-precision value (all will be positive). The return value from function get_nan will have a fraction field where each of the bits is a 1. The next five functions will return 0 if the specified condition is false, and 1 if the condition is true. Functions negate and absolute will perform the appropriate operation on the argument and return the result.

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_2

Step: 3

blur-text-image_3

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

Database Internals A Deep Dive Into How Distributed Data Systems Work

Authors: Alex Petrov

1st Edition

1492040347, 978-1492040347

More Books

Students also viewed these Databases questions

Question

How does a companys current ratio differ from its quick ratio?

Answered: 1 week ago

Question

Discuss cross-cultural differences in perception

Answered: 1 week ago