Posts tagged cpp
Fixed point math in pure CPP
2007 Oct 31st
NOTE
This post has been previously published on 2007/Oct/31: due to my move to another server i’m now in the process to manually recover the comments for this article. Fixed!
Some time ago i was asked to publish my implementation of fixed-point math, mainly regarding embedded architectures where IEEE floating point computations have really bad performances. What i want to give you here is a pure-c++, template-based implementation of a fixed-point datatype: this thing is more of a test in order to see how much an object-oriented implementation can perform, being in contrast to a more traditional implementation. As expected, operator overloading and temporary object creation overhead are the main issues with a full-oo implementation as this one, anyway, its a damn nice way to exercise yourself in writing c++ policy-based templated code ;)