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

@eniko I remember reading about fixed-point math in asm tutorials that date back to the '90s and they made this clear with gorgeous ASCII drawings. I wonder what kind of resources show up today in a search and why they fail to explain this part
@gabrielesvelto i've read about fixed point math many times on the modern internet and i don't think i've ever seen this pointed out. i had to come to it on my own and it's not super intuitive
@eniko @gabrielesvelto I seem to remember the "Graphics Gems" series of books containing a lot of great information on fixed point maths, including various useful algorithms. Unfortunately I'm pretty sure those books are long out of print (exorbitant prices anyway) - I read them at our university library over 20 years ago.
@pmdj @eniko I'm sure there must be copies on the Internet Archive
@eniko and ofc this is also important for different types of fixed-point operations, like how you can do repeated divisions by multiplying by the reciprocal of the divisor where the reciprocal is just (1 << $precision) / $divisor

@gabrielesvelto it's also very important because with fixed point you constantly have to figure out what precision you want for a particular problem domain so that you know your limits and when overflow could occur

which means different types with different levels of precision are best but nothing ever explains it in a way where a newcomer would feel comfortable mixing different fixed point types, leading to worse results

@eniko indeed. I can see how that can be a problem for something like rasterization, where you need a certain amount of subpixel precision but not necessarily as much as what you need for dealing with geometry... but you're converting between the two if your entire pipeline is fixed-point so the problem does come up in relatively common situations

@eniko oh look! Some of that stuff is still available! I haven't found the 68000 ones but those are probably in .lha files on Aminet.. In the meantime check out some classic tutorials on software rendering like fatmap.txt, fatmap2.zip or texture.txt.

https://mikro.naprvyraz.sk/docs/Coding/1/
https://www.gamers.org/dEngine/rsc/pcgpe-1.0/

This stuff is an incredible resource to understand how things were done back in the day, what were the constraints and the reasoning around them.

Index of /docs/Coding/1

@eniko hah, look at this stuff! This is a gold mine: https://flipcode.com/archives/articles.shtml
flipcode - Featured Articles

@eniko I'm bookmarking all these things and making sure they're on the Internet Archive too: https://www.modeemi.fi/drdoom/3dica/
3DICA Programming Tutorial