One syntax doubt

sir, at 5:07, in line 22, if n is odd then it should be " smaller_ans(a,(n-1)/2)a " instead of ’ smaller_ansa ’

hello @chandreshmaurya

no , we already have computed small = fast_pow(a,n/2) i.e a^((n-1)/2)
then we take its sqaure i.e small= small * small.

so now small is now eqaul to a^(n-1)

to get a^n we again need to multiply a into a^(n-1) .

that is why in line 22 we are doing a*small

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.