Researchers have proved that they are able to calculate in their heads whether the number of dots on a screen is increasing or decreasing.
They can then make a decision based on that finding, the experiment found.
Professor Andreas Nieder, who led the study at the University of Tubingen, Germany, believes the finding suggest that basic mathematics is "hard-wired into evolution".
"It is a primitive version of maths which we think has a survival advantage," he said. "If you are foraging then it is an advantage to choose a tree with more berries on it.
"Similarly it is important that a monkey knows the number of individuals in his or her social group and compares it with rival groups. To know whether to attack or retreat."
The study, published in the Proceedings of the National Academy of Sciences, involved training monkeys to recognise the number of dots on a screen flashed before them and compare them with subsequent sets of dots shown to them later.
If a red light was flashed before them later, then they had to pull a lever if there were more dots in the second image and if a blue circle flashed before them then the lever had to be pulled if it contained less dots.
The monkeys, who were given apples or water as a reward, made the correct decision up to 90 per cent of the time.
Full story here.