#include <stdio.h>
#include <stdint.h>
#include <math.h>
int main()
{
// 0111 1111 1111 1111
int16_t q_max = 32767; // 0x7FFF
// 1000 0000 0000 0000
int16_t q_min = -32768; // 0x8000
float f_max = 0;
float f_min = 0;
printf("\r\n");
for (int8_t i = 15; i>=0; i--) {
f_max = (float)q_max / pow(2,i);
f_min = (float)q_min / pow(2,i);
printf("\t| Q %d | Q %d.%d| %f | %f |\r\n",
i,(15-i),i,f_max,f_min);
}
double a = (double)52872 / pow(2,16);
printf("%.7lf\n",a);
return 0;
}
01-22
762
11-14
1613
07-03
2341