Investors in Sanmina (SANM 0.45%) are having a terrific Tuesday. After Sanmina reported fiscal first-quarter 2024 earnings after the close Monday that exceeded analysts' expectations, shares of the electronics manufacturing company rocketed as much as 37.5% higher in early trading Tuesday, and were still up by 28% as of 11 a.m. ET.

Heading into the quarterly report, analysts had forecast Sanmina would earn $1.22 per share, adjusted for one-time items, on sales of $1.87 billion. Sanmina nailed the sales target, and beat the earnings goal with a $1.30 per share profit.

Sanmina Q1 sales and earnings

"Our team did a great job delivering first quarter financial results in line with our outlook," said CEO Jure Sola, and no doubt that's true. However, actual earnings as calculated according to generally accepted accounting principles (GAAP) fell a bit short of the adjusted numbers cited above. Sanmina said its GAAP profits for the quarter were only $0.98 per share -- and that number was down 36% from fiscal Q1 2023. Sales also declined about 21% year over year.

As you might expect after seeing profits fall more sharply than sales, Sanmina suffered a decline in operating profit margin, which slipped by about 70 basis points to 4.7%. On the plus side, while Sanmina's sales were down, its gross profit margin per dollar sold improved by about 40 basis points to 8.6%.

What's next for Sanmina

Turning to guidance, Sanmina warned that its results in fiscal Q2 will be "essentially flat" against Q1. Once again, sales of about $1.87 billion or so are expected. Once again, GAAP earnings per share should land in the $0.95 to $1.05 range.

Also once again, Sanmina's adjusted earnings will look better than its GAAP results. It's guiding for a range of $1.20 per share to $1.30 per share. So it's likely the adjusted number in fiscal Q2 will actually decline a bit from fiscal Q1 -- but even on that front, there's some good news to report. Wall Street, it turns out, was expecting a bigger adjusted profit decline to $1.09 per share in fiscal Q2.

Strange as it is to say, therefore, despite warning of a decline in profitability in fiscal Q2, Sanmina's actually still forecasting that it will beat Wall Street's earnings estimates for a second straight quarter. For a stock that was as low-priced as Sanmina -- trading at less than 10 times trailing earnings -- that was good enough news to get investors excited Tuesday.