|
|
|
|
|
by midjji
1639 days ago
|
|
Fixedpoint is great, but floating point behave more like how people appear to expect timestamps to work. That said, I like so many others have written my own damned fixed point function for various reasons, and like everyone else I got it wrong several times on the way. If only there was a simple template class that could take care of it for you, but well, such a simple template class would really just be a basic numeric type anyways, so why not include it in the specification, ensuring that a high performance, extremely well tested variant was available everywhere form the start. Imagine how many millions of hours of coder time could have been saved if the C specification included fixedpoint<20,12> (or however you wanna write it), and thus would have created a single standard implementation for all of them. Having not just basic arithmetics, but decent sin, cos, sqrt, atan2 etc, all parth of cmath. The difference now would be minor with soft float beeing ubiquitous, but back when it was faster... Damn. |
|