2 ms·
> 100 times Practice is how we cement things into our minds and get good at them. Of course it is repetitive and boring. Someone could teach you how to throw
by WalterBright 6y ago
> 100 times
Practice is how we cement things into our minds and get good at them. Of course it is repetitive and boring.
Someone could teach you how to throw a basketball into a hoop. Want to get good at it? Repeat it 30,000 times, not 100.
When it became time for me to implement division for the 8086 processor, I implemented the exact same long division algorithm I was taught in 3rd grade, except using binary rather than base 10. Shift-subtact-add.
https://github.com/DigitalMars/dmc/blob/master/src/CORE16/LMATH.ASM#L102 https://github.com/DigitalMars/dmc/blob/master/src/CORE16/LM...
Did it again to create the floating point emulator.
https://github.com/DigitalMars/dmc/blob/master/src/CORE16/FLOAT.ASM#L598 https://github.com/DigitalMars/dmc/blob/master/src/CORE16/FL...
It turns out there are faster algorithms (see Hacker's Delight), but those aren't very amenable for pencil and paper.