I have this factorial function that is currently working, but the result I'm having is not the one I need.
The code is:
declare
fun {Fact N}
if N==1 then [N]
else
Out={Fact N-1}in
N*Out.1|Out end
end
{Browse {Fact 4}}
The result is : [24,6,2,1]
but I need that the result shows: [1,2,6,24]
and I can't see where the error is.