Use a linux contraption (camelot, excalibur or merlin flavors of Linux) and write a 'C' program to print the following "floating" point numbers in Hex format:
a) 9.6875
b) the smallest number greater than Zero
c) Infinity
d) Not a number
Also, print the following numbers declared as "double"
e) 9.6875
f) 2.7
You could use the following connotation:
................
float f;
double d;
int *p;
f=1.0;
p=(int *)&f;
printf("%08x",*p);
d=1.0
p=(int *)&d;
printf("%08x %08x",*(p+1),*p); //Little endian format
The following code have to done at the earliest!!!?
What is the difference between (a) and (e)?
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment