Next:Notes on Strcmp
Up: Overview
Previous: Rex86 Sample - Your Name
Notes on Division
Why is there no DIV instruction?
- General division is rarely needed, HALF usually suffices
- Students expect division to produce a fraction, not an integer
- DIV has two outputs
- Division on negative numbers is poorly defined
- Has the potential to crash a program by dividing by zero
- Division algorithm is a great algorithm
- If the instruction is already there, algorithm isn't needed
- Teaching the algorithm helps them understand why DIV is hard
Of course this means int to text cannot be done (without writing our own division procedure). That's ok. Text to int will teach much of the same lessons.
Next:Notes on Strcmp
Up: Overview
Previous: Rex86 Sample - Your Name
by dlong@progmatism.com. Plz don't copy kthx.