I) I'll use rafb/paste now, it's just easier to read. MUL and DIV now have a range check (set to MIN and MAX values) und use long long as intermediate. ADD und SUB still wrap around.
Fixed Point Class C++
II) I keep the question if parameter passing by value or reference is better to you guys. I don't feel like reading gcc's ARM ASM. In case we have tp bloat the class more, pass by refernece becomes a must anyway.
III) I decided to fix magnitude.fraction to 16.16 for now and make it variable after everything works.
IV) I use normaly a degree sinus LUT with 360 fixed entries. This need rad->degree conversion or natively working with degrees what I do anyway. A precision of 1 degree should be enough for 2D stuff. Any comment on this or simple ideas to have a small but precise LUT(s)?
V) I did not understand the square root code posted earlier, I'll look for solution (any hints?). But a sqrt() would need a NaN value (root from negative value) as DIV by zero should already have. As we are on it, saturation anyone?