For arbitrary functions you usually want floating point, which solves the overflow problem in a different way.