Thursday, July 9, 2009

In C language, what is the formula or syntax to convert fixed-point into floating point?

You just need to cast it.





float fl;


int fixed = 10;





fl = (float)fixed;


printf("%d is %f\n", fixed, fl);


No comments:

Post a Comment