Math related utilities.