Earlier quoted context omitted.
Did you use floating point or fixed point numbers?
I can't see any reason to use fixed point numbers here, seems like floating point would be perfectly sufficient.
https://stackoverflow.com/questions/3730019/why-not-use-doub...