#this one I just learned about this thing
39 messages · Page 1 of 1 (latest)
⌛ This post has been reserved for your question.
Hey @dim wyvern! Please use
/closeor theClose Postbutton above when you're finished. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
0 multiplied by anything will always be zero. Also 0! is equal to one. You should not return 0 but 1 if its 1 or 0
I do not get it
WAIT DANISH COMING
@sturdy copper
HERE
alright but you understand that 0*something will always result in 0
Yes
what happens when you return 0 for x ?
Become 0
Oh wait I put 1 and it work
I do not get recursion
It is so stupid
I learn when something is return then it stop
Now idk anything
I return it and then it go back to the method then it return the x and somehow become this answer idk
do you know about the successor function in math
No
ok so basically the kind of step down multiplication to addition is, is the same as addition to succession
S is the successor function, it's defined as:
S(0) = 1
S(1) = 2
etc
from the 2 given equalities above, you can say S(S(0)) = 2
this is the basis of the logic of recursion
suppose a function f as follows
f(0) = 0
f(n) = f(n-1) × n
this is a recursive function in math (well not exactly, the definition would look a bit different, but you get the idea)
from the definition, f(0) is the base case, it has a constant value