More math related helpers.