Refering Notation for fixed point representation i have tried following, but i am totally confused.
int q = 1<<15;
printf("(sys3.b0 * q) = %hx \n",((0.2929 * q)));
output is
((0.2929 * q)) = cc60
I expect to see 257d because from calculator, 0.2929 * 32768 in hex = 257d
What is the problem in using this Q.15 format, or is this just because of not properly printing
EDIT
Guys, actually i've never thought of it.
My actual code tries to print two values. I thought 2nd value printing is the problem. After comments of @Soren i copied his code and is working. Then i removed 1st value from printf, my code also worked. So i repost the printf statement
printf("(sys3.b0 * q) = %X \t((0.2929 * q)) = %X\n",(sys3.b0 * q),(unsigned)((0.2929 * q)));
printf("(sys3.b0 * q) = %X \n",((unsigned)(0.2929 * q)));
where the second line is as suggested by Seron.
The value of sys3.b0 = 0.0000000001295
Now the output is
(sys3.b0 * q) = 4DB173CF ((0.2929 * q)) = 3ED1CC60
(sys3.b0 * q) = 257D