# Question regarding definition of recursive function

According to Wikipedia, and also a very common definition of a recursive function found in several books, "functions that call themselves from within their own code". I agree that this solves the problem for most of what I think recursive functions are, but, suppose you have the following "iterative" code written in C:

int foo(){
return 2;
}


The unique pourpose of this function is to compute the value "2". Can we say this is also a "recursive" function? Saying it only relies in a base case. I can see the function isn't calling itself in their body, even though, I can't find a way to compute it in another way, using the self-calling part.

Besides, I'm aware of the fact that every iterative function has a recursive implementation, so, in this case this function does have the same implementation for the iterative and for the recursive view?

• Computer science definitions must be interpreted literally. Since there is no call, it is not recursive. – beroal Jun 15 '20 at 7:41
• @beroal I see. How can I give a recursive definition of a constant function? – Jay Jay Jun 15 '20 at 14:52
• For example, return true ? 2 : foo(); in C. – beroal Jun 15 '20 at 20:16
• @beroal but in a general way? In a mathematical way? – Jay Jay Jun 15 '20 at 20:18