If you can find a tutorial on how to compile a dll, the actual code for the dll would be quite simple.
Pseudocode:
function longdivision return $1 / $2
There are likely extension files that would need to be included in the dll to allow large math operations.
-genius_at_work