[math-fun] an unreasonably handy tool