add a function to smart add values (so we keep the maximum allowable precision)

Signed-off-by: Riccardo Iaconelli <riccardo@kde.org>