General math routines I find useful when developing.