- Feb 21, 2004
- 3,875
- 3
- 81
Has anyone tried programming microcontrollers such that, in order to avoid floating-point operations (which they essentially can't do), you simply multiply any decimal numbers you use by 10^x power to make it a large enough integer to do the job and just run everything as if it were at 10^-X power? I tried that on a simple program where it needed a constant of like 0.323 or something and just used 323; the numbers were large enough that when the actual value was needed you could just divide by 1000 and the remainder was insignificant. Does that hold any promise for more complicated code?