general-purpose function

noun
UK /ˈdʒɛnərəl ˈpɜːpəs ˈfʌŋkʃən/
US /ˈdʒɛnərəl ˈpɜːrpəs ˈfʌŋkʃən/

A general-purpose function is a tool that can do many different jobs.

The teacher said this general-purpose function can help us with lots of different tasks.


OTHER MEANINGS

2. In computing, a reusable block of code designed to handle a wide range of inputs rather than one specific task.

The programmer wrote a general-purpose function to sort any list of numbers.

3. A feature or role that serves many needs instead of being limited to one use.

A pocket knife is a general-purpose function for campers who need many tools.

4. A mathematical rule that can be applied broadly across different kinds of values.

The formula works as a general-purpose function for many shapes.