I am trying to convert data from float to fr16, do some arithmetic with the fr16 and then convert back to float as a test. I am using VisualDSP++5.0 with the Family Compiled Simulator.
Here is my code:
float floatnumber, floatnumber2, addedfrac16fl;
fract16 frac16number, frac16number2, addedfrac16fr;
//convert to fr16
//convert to float
printf("addedfrac16fl= %f\n", addedfrac16fl);
Print statement shows: addedfrac16fl= 0.002441
Why is it that adding 0.001234+0.001234=0.002441?? Doesn't the datatype fr16 have enough significant digits so that there shouldn't be any error?? Or is the add_fr1x16 not doing what I think it is doing?