While I sit at my desk in Fool HQ, watching the market surge higher, there's a company that I believe is undervalued -- Inside Value selection Wal-Mart (NYSE:WMT) -- that's down almost 2%.

Although Wal-Mart didn't exactly report a stunning quarter, I don't believe the results are as bad as they first appear. Revenues increased 11.3% and gross margins improved by 90 basis points, but the company lost some steam further down the income statement; income from continuing operations and earnings per share from continuing operations increased only 4.6% and 5.9%, respectively. That's not a terrible performance, but it does pale in comparison to what Target (NYSE:TGT) posted last week.

However, other parts of the business did quite well. The company continues to improve its inventory position and keep inventory growth below sales growth. The working capital performance is beginning to trickle through to cash flow from operations, and in turn free cash flow is up to $448 million through the first six months, against only $14 million last year. This free cash flow performance (though recent) is a material improvement over the last two years, and the company's capital expenditures are running ahead of where they were last year. (For more on the numbers, see our Fool by Numbers from earlier today). It's not a perfect performance, but the company's ability to focus on return on invested capital while maintaining growth appears to be working.

The charges the company has incurred to exit South Korea, and now Germany, are a bit frustrating. But the flip side is to give the company credit for biting the bullet and shutting down operations where it was losing money and didn't see itself being able to compete in the long term. That said, investors will want to pay close attention to the company's efforts with Seiyu in Japan and its operations in South America and China, which are a large part of the long-term Wal-Mart growth story.

I'm intrigued by Wal-Mart, but I already own a fair amount of Costco (NASDAQ:COST) shares and am not inclined to jump into Wal-Mart and have an oversized chunk of my portfolio in large-cap retail. However, if Wal-Mart continues to perform reasonably well and still gets the cold shoulder from investors, I may have to revisit my stance, because I ultimately think the company will outperform the low level of growth that is priced into the shares.

Costco is a recommendation of Motley Fool Stock Advisor , where Tom and David Gardner are always on the lookout for the market's best investments. Try it out for yourself -- it's free for 30 days .

At the time of publication, Nathan Parmelee owned shares in Costco, but had no interest in any of the other companies mentioned. The Motley Fool has an ironclad disclosure policy .