Ginni Rometty, CEO of IBM on Mad Money to discuss IBM's acquisition of Redhat. Adam Jeffery | CNBC

IBM shares rose as much as 7 percent after the company reported better-than-expected full-year guidance and fourth-quarter results on Tuesday. Here are the key numbers: Earnings: $4.87 per share, excluding certain items, vs. $4.82 per share as expected by analysts, according to Refinitiv. Revenue: $21.76 billion, vs. $21.71 billion as expected by analysts, according to Refinitiv. Revenue fell 3 percent year over year, according to a statement. The company has now reported revenue declines for two consecutive quarters.

For all of 2018, IBM generated $13.81 in earnings per share, excluding certain items. Analysts had expected $13.78 per share for the period, according to Refinitiv. IBM's largest business segment, Technology Services and Cloud Platforms, posted $8.9 billion in revenue. Analysts polled by FactSet were expecting $9.04 billion in revenue from the segment. The next-largest business segment, Cognitive Solutions, did $5.5 billion in revenue. That exceeded the FactSet consensus estimate, which was $5.27 billion. IBM's Global Business Services segment collected $4.3 billion in revenue, exceeding the $4.15 billion estimate, and the Systems segment came in at $2.6 billion, below the $2.77 billion estimate. The Global Financing segment contributed $402 million in revenue, under the $426 million estimate. In the quarter IBM announced its intent to pay $34 billion to acquire Red Hat, announced a chip manufacturing deal from Samsung and sold software assets to HCL Technologies for $1.8 billion. The Red Hat deal is expected to close in the second half of 2019.