How are the min and max values calculated for an arbitrary mesh? (for setting bounding volumes)

I know it has something to do with adding up the total verticies, and then dividing or subtracting something else..or not. I don't really know.

Thanks.