Static function vs function static

1.My question is Module inside all the function are static in nature but how the output is behaving like an automatic .Any one can help me

module tryfact;
  // define the function
  function  integer factorial (input [31:0] operand);
  begin
    if (operand >= 2)
    factorial = factorial (operand - 1) * operand;
    else
    factorial = 1;
  end
  endfunction: factorial
  // test the function
  integer result;
  initial begin
    for (int n = 0; n <= 7; n++) begin
      result = factorial(n);
      $display("%0d factorial=%0d", n, result);
    end
  end
endmodule: tryfact

Output :

0 factorial=1
1 factorial=1
2 factorial=1
3 factorial=1
4 factorial=1
5 factorial=1
6 factorial=1
7 factorial=1

In reply to Om Ganesh B k:

Please use

(https://verificationacademy.com/forums/announcements/please-format-your-code-code-and/code-tags) making your code easier to read. I have added them for you.

Your output is not the same as if you had declared the function as automatic

``` verilog
function automatic  integer factorial (input [31:0] operand);

I get

[code]# run -all

0 factorial=1

1 factorial=1

2 factorial=2

3 factorial=6

4 factorial=24

5 factorial=120

6 factorial=720

7 factorial=5040