_xxx_ said:
You can calculate everything as floating point. Integer 1234 is float 1234.0F, no problem there except maybe for higher memory usage and a few more CPU cycles needed.
if you mean single-precision fp - unfortunately no. sp floats do not have the mantissa to represent correcly every integer value above 2^24 (up to max (unsigned) int32). say, 2^32-1 (i.e. max unsigned int32) cannot be represented precisely in sp fp. same with double-precision floats and integers above 2^53.
Last edited by a moderator: