Implementation of math functions from Cracked

http://www.cracked.com/article_19360_7-questions-you-didnt-know-could-be-answered-with-math.html