Convert the binary outputs into hexadecimal and record the values (note you can
ID: 3750563 • Letter: C
Question
Convert the binary outputs into hexadecimal and record the values (note you can convert from binary to hex with a short look-up table, or, with a little practice, in your head).
char myVar = 0b01111110;
float myVar = 3.14159265
unsigned int myVar = 65526
float myVar = 3.14159
How many base-10 significant digits can be represented using a floating point datatype. What you do to increase the precision?
float myVar = 3.14159
How many base-10 significant digits can be represented using a floating point datatype. What you do to increase the precision?
Explanation / Answer
1. char myVar = (0111) (1110) => 7E
3. unsigned int myVar = 65526 => 1111111111110110 in binary => (1111) (1111) (1111) (0110) =>FFF6 in hex
4.
float 3.141592665
so .141592665 in binary 0010010000111111011011 an 3 in binary is 11
so 3.141592665 =>11.0010010000111111011011 x20 => 1.10010010000111111011011 x 21
so E =127+1=> 128=>10000000
M= 10010010000111111011011
S=0
so number in binay:
SEM => 0 10000000 10010010000111111011011
=>(0100) (0000) (0100) (1001) (0000) (1111) (1101) (1011) =>40490FDB
please give thumbs up, thanks