(PHP 4 = 4.0.4)
Calculate (base raised into power exp) modulo mod. If exp is negative, result is undefined.