This function produces correct results only when it is known in advance that d divides n.
Divides n by d, using fast "exact division" algorithm. This function produces correct results only when it is known in advance that d divides n.