function f = factorialDouble(n)
% factorialDouble(n) returns the factorial of n with all calculations of type double.
   f=1;
   while(n>1)
       f=f*n;
       n=n-1;
   end