In this tutorial you can see how to use div and mode operators. The example shows how to calculate the change for a given number of cents.