Apple is close to becoming the first publicly listed U.S. company valued at $1 trillion, but figuring out exactly how close requires doing a little math.