Are there any examples of functions that take inputs of different types (for example number, String) and produce output?

39 Views Asked by At

In programming it is rather the norm than the exception to have functions whose input are different data types. For example a function who produces a substring of a given string would have the following signature in Java:

public static String substring(String s, int n) {..}

Are there examples of such functions in Mathematics and what is their application?