A minimal collection of comments and references might be worthwhile here. It's the sort of thing many programmers seem to find both intriguing and difficult.
CategoryMath