When a function always returns the same value for a given parameter or parameter set and never modifies anything outside of the function scope (side effects), that function is called a pure function; in fact, you can replace no-argument pure functions with constants. The concept of a pure function is completely based on mathematical functions, for instance, in the mathematical function y = f(x), for a given value of x, y (both constants).
Let's take a look at the following example:
class Calculator {
var anyVariable: Int = 0
fun add(a: Int, b: Int): Int = a + b // pure function
fun multiply(a: Int, b: Int): Int = a * b // pure function
fun subtract(a: Int, b: Int): Int = a - b // pure function
fun divide(a: Int, b: Int): Int = a / b // pure function
fun anyFunction(x: Int): Int { // not a pure function...