fixed point is taught wrong. instead of saying "to multiply two fixed point values you have to multiply them then shift them back into position" what it really should be is "when you multiply two fixed point values the result has a fractional precision in bits equal to the sum of the fractional precision of the two fixed point types multiplied"
this not only makes it easy to see *why* you have to shift (the fractional precision increased, so if you want to keep a lower one you have to shift) but it also makes it clear how multiplication between two fixed point types with different fractional precision works

if you multiply a fixed point value with 2 bits of fractional precision and one with 4 bits you wind up with a result that has 6 bits of fraction. if you want a result with 3 bits of fraction you shift right by 6-3=3 bits

this is easily understood, but only if the underlying concept is properly explained from the start

this also makes it easier to see that if you're transforming a fixed point type into another fixed point type via multiplication (like position * position = edgeweight for a rasterizer) you may want to not shift at all if you want the resulting fixed point type to represent the transformation precisely without any rounding

@eniko

I like your funny words magic fox

I understand nothing of precision almost everything I've ever done, has not needed to strictly worry about types apart from java but that felt different

I have a book on C programming on my floor I should probably get to at some point...

@eniko but more seriously.. uh this sounds cool but also legitimately.. out of my knowledge zone by quite a bit., right over my ears n tail.

@LottieVixen @eniko I know this is a rabbit hole and completely inefficient, but C may not be as helpful here as some archaic assembly coding. http://bitsavers.informatik.uni-stuttgart.de/pdf/ibm/7090/books/Saxon_Programming_the_IBM_7090_1963.pdf Saxon's tutorial for thd IBM 7090 is pretty clear with a strong focus on both fixed and floating point math at the machine code level. It's tedious bit tracking but it's methodical, practical, and straightforward and gets the ideas across without having to look past the thin abstractions C puts in the way.

Bonus: If you actually want to run the examples, simh has an IBM 7090/7094 emulator plus all the OS & tooling you might need to program like it's 1964. The Saxon book does not assume you have your own 7090 and is perfectly usable on its own. It's also a good reminder of why we use high-level languages especially where math is concerned. Floating-point at the machine code level is really tedious