The calculation allows them to use up their starch reserves at a constant rate so that they run out almost precisely at dawn.
"This is the first concrete example in a fundamental biological process of such a sophisticated arithmetic calculation," said mathematical modeller Professor Martin Howard from the John Innes Centre.
Plants feed themselves during the day by using energy from the sun to convert carbon dioxide into sugars and starch. Once the sun has set, they must depend on a store of starch to prevent starvation.
In research to be published in the open access journal eLife, scientists at the John Innes Centre show that plants make precise adjustments to their rate of starch consumption. These adjustments ensure that the starch store lasts until dawn even if the night comes unexpectedly early or the size of the starch store varies.
The John Innes Centre scientists show that to adjust their starch consumption so precisely they must be performing a mathematical calculation - arithmetic division.
"The capacity to perform arithmetic calculation is vital for plant growth and productivity," said metabolic biologist Professor Alison Smith.
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 our own body clock. The size of the starch store is then divided by the length of time until dawn to set the correct rate of starch consumption, so that, by dawn, around 95% of starch is used up.
"The calculations are precise so that plants prevent starvation but also make the most efficient use of their food," said Professor Smith.
"If the starch store is used too fast, plants will starve and stop growing during the night. If the store is used too slowly, some of it will be wasted."
The scientists used mathematical modelling to investigate how such a division calculation can be carried out inside a plant. They proposed that information about the size of the starch store and the time until dawn is encoded in the concentrations of two kinds of molecules (called S for starch and T for time). If the S molecules stimulate starch consumption, while the T molecules prevent this from happening, then the rate of starch consumption is set by the ratio of S molecules to T molecules, in other words S divided by T.