Plants do complex arithmetic calculations to make sure they have enough food to get them through the night, new research published in journal eLife shows.
Scientists at Britain's John Innes Centre said plants adjust their rate of starch consumption to prevent starvation during the night when they are unable to feed themselves with energy from the sun.
They can even compensate for an unexpected early night.
"This is the first concrete example in a fundamental biological process of such a sophisticated arithmetic calculation," mathematical modeler Martin Howard of John Innes Centre (JIC) said.
During the night, mechanisms inside the leaf measure the size of the starch store and estimate the length of time until dawn. Information about time comes from an internal clock, similar to the human body clock.
"The capacity to perform arithmetic calculation is vital for plant growth and productivity," JIC metabolic biologist Alison Smith said.
"Understanding how plants continue to grow in the dark could help unlock new ways to boost crop yield."