Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The assignment has to be writtin in the formal language C Write a member function that takes a standard float variable, converts and stores it

image text in transcribed The assignment has to be writtin in the formal language C

Write a member function that takes a standard float variable, converts and stores it in your representation. As we are simplifying here, you are allowed to use any standard C float and int operations (divisions, modulo, typecasting). Start by enforcing the limits you determined in the previous point. Convert the whole part of the number to a short int and write it as a binary number into a character array (e.g., using snprintf). Convert the fractional part to a binary fraction and write it into the same array, while keeping track of where the binary dot should be. Convert the mantissa to cannonical form and calculate the value of the exponent. Using bit shifting and bitwise OR/AND operations, write the corresponding values from the character array into the data member. Write a member function that takes a standard float variable, converts and stores it in your representation. As we are simplifying here, you are allowed to use any standard C float and int operations (divisions, modulo, typecasting). Start by enforcing the limits you determined in the previous point. Convert the whole part of the number to a short int and write it as a binary number into a character array (e.g., using snprintf). Convert the fractional part to a binary fraction and write it into the same array, while keeping track of where the binary dot should be. Convert the mantissa to cannonical form and calculate the value of the exponent. Using bit shifting and bitwise OR/AND operations, write the corresponding values from the character array into the data member

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

Professional SQL Server 2000 Database Design

Authors: Louis Davidson

1st Edition

1861004761, 978-1861004765

More Books

Students also viewed these Databases questions

Question

What was the role of the team leader? How was he or she selected?

Answered: 1 week ago

Question

What were the issues and solutions proposed by each team?

Answered: 1 week ago