Plants have a built-in capacity to do maths, which helps them regulate food reserves in the night, say UK scientists.