C++ Have the user input a Float (ex: -15.750) and the output must display the following: Float Number (what the user inputted), Sign (If the user inputted a positive or negative Float), Whole (binary), Fractional, Exponent, Mantissa and IEE 754. NO library functions like atoi. These are the steps that I have so far: Input a Float Check if Float is Pos or Neg -> store 0 or 1 (and then make it positive to make it easier) Split the float into whole (int) and fractional (float) Convert whole number into binary (if whole == 0) like (0.1231), then just store 0 into the binary Convert fractional to binary Find exponent bias Convert exponent bias to binary Create the mantissa Create IEE754 (the whole thing) OUTPUT: Float Number: Sign: Whole (Binary): Fractional: Exponent: Mantissa: IEE 754:
C++
Have the user input a Float (ex: -15.750) and the output must display the following: Float Number (what the user inputted), Sign (If the user inputted a positive or negative Float), Whole (binary), Fractional, Exponent, Mantissa and IEE 754.
NO library functions like atoi.
These are the steps that I have so far:
Input a Float
Check if Float is Pos or Neg -> store 0 or 1 (and then make it positive to make it easier)
Split the float into whole (int) and fractional (float)
Convert whole number into binary
(if whole == 0) like (0.1231), then just store 0 into the binary
Convert fractional to binary
Find exponent bias
Convert exponent bias to binary
Create the mantissa
Create IEE754 (the whole thing)
OUTPUT:
Float Number:
Sign:
Whole (Binary):
Fractional:
Exponent:
Mantissa:
IEE 754:
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 3 images