Revenue for the fourth quarter of 2018 was $163 million, compared to $167 million in the fourth quarter of 2017. Net loss for the fourth quarter of 2018 was $13 million, or $0.33 per diluted share, compared to net loss of $98 million, or $2.42 per diluted share in the fourth quarter of 2017. Non-GAAP net loss was $9 million, or $0.22 per diluted share for the fourth quarter of 2018, compared to non-GAAP net income of $9 million, or $0.22 per diluted share in the fourth quarter of 2017.
2017 GAAP results were impacted by both the new U.S. tax law and a change to the valuation allowance held against the company's U.S. deferred tax assets. The combined negative impact on the company's 2017 GAAP net loss was $103 million and was excluded for non-GAAP purposes.
For 2018, overall gross profit margin on a GAAP and non-GAAP basis was 29%, compared to 33% and 34%, respectively, on a GAAP and non-GAAP basis in 2017.
GAAP operating expenses for 2018 were $204 million, compared to $196 million in 2017. Non-GAAP operating expenses for 2018 were $191 million, compared to $177 million in 2017.
As of December 31, 2018, cash, investments, and restricted cash totaled $246 million. Working capital at the end of 2018 was $291 million, compared to $354 million at December 31, 2017.
"Led by strength in our commercial business, we delivered solid growth for the year", stated Peter Ungaro, president and CEO of Cray. "While our target market continues to show signs of a rebound from its recent lows, 2019 is shaping up to be a transition year as we plan to begin shipping our next generation Shasta platform late this year. Shasta will deliver a balance of performance, flexibility and ease of use unlike anything available today, as well as a true exascale-class architecture capable of scaling well into the future. With continued focus and execution, we are well positioned to expand on our market leadership position and deliver strong long-term growth."
For 2019, while a wide range of results remains possible, Cray expects revenue to grow modestly compared to 2018. Revenue is expected to be about $70 million for the first quarter of 2019. For 2019, GAAP and non-GAAP gross margins are expected to be in the 30% range, and non-GAAP operating expenses are expected to grow compared to 2018. Based on this outlook, the company expects to recognize a substantial GAAP and non-GAAP net loss for 2019.
Cray's effective GAAP and non-GAAP tax rates for 2019 are both expected to be in the low single-digit range.
Actual results for any future periods are subject to large fluctuations given the nature of Cray's business.
Recent highlights include the following: