I remember reading it about a decade ago in school, I seem to recall the giant robot maybe being angry that he couldn't make 2 numbers add up to each other.
This sounds like a shot story "Trurl's Machine" from Stanislaw Lem's Cyberiad.
Giant computer insists that two plus two is seven and things soon become violent.
Once upon a time Trurl the constructor built an eight-story thinking machine. [...]
Extremely pleased with himself, he whistled an air and, as is always done on such occasions, asked it the ritual question of how much is two plus two.
The machine stirred. Its tubes began to glow, its coils warmed up [...]
"SEVEN!" snapped the machine. Trurl sighed and put his coveralls back on, rolled up his sleeves, opened the bottom trapdoor and crawled in.
[... They argue about this for some time, and the machine flies into a rage ...]
The machine was gathering momentum, clearly bent on running them down, so they fled just as fast as they could, the fearful rhythm of crunching steps in their ears.