There’s nothing like a little magical math to make banks’ financial woes go away.

Bank stocks have surged in recent weeks, a sign that investors are betting the worst of the financial crisis is over. But in reaching this conclusion, the market has chosen to ignore some creative accounting banks are using to bolster their finances.