A function to handle multiple datatypes

However I don't have any objections to templates, which, in effect, produce multiple functions.