News for hackers. Stuff that matters.
Re:Ask HN: What should a systems/low-level software engineer... by zozbot123 on Friday January 11, 2019 @09:57AM (#18883930)
Fixpoint arithmetic is going to be significantly more efficient than floating point in many cases, except where you need to use relatively-uncommon operations/functions (which are hardware-accelerated in the FPU), or in cases where the same value might span multiple orders of magnitude (i.e. a direct win for the floating point representation). The inner loop of a microcontroller is not generally one of these cases, though exceptions might be out there.
Re:Ask HN: What should a systems/low-level software engineer... by m-ee on Monday January 14, 2019 @11:17PM (#18908817)
I was surprised it was faster, from what I remember to avoid floating point operations several large values had to be multiplied together then divided which required using a long long to avoid overflow. The division operation was quite slow. Thinking back I'm not 100% sure it was in the inner control loop but at the very least it was required to generate the new motor position.

Anyway a bit toggle tells all, and if you're making speed optimizations you should be checking that things actually got faster.