A possible solution is to extract the fractional components for the mantissa and the exponent from the bits encoded in the comp_t value supplied and to create a double number from these fractional components. This algorithm is coded in the function comp_t_to_double() as given below.

```
/* This function converts from comp_t to double value for exponent base 10. */
double comp_t_to_double(comp_t value)
{
double dval = 0;
int exp = 0;
/*
* Get the fraction components.
*/
exp = value >> MANTSIZE; /* Get the exponent (first 3 bits). */
dval = (value & MAXFRACT); /* Get the mantissa (last 13 bits). */
for(int i=0; i < exp; i++) {
dval /= 10;
}
return dval;
}
```