in reply to root function
I have also found the Math::NumberCruncher module, which seems to have a function for that.