How does the code change if i change f from int to double? :     int f=1;  //this is to store factorial value
    double s=1;
       for(int i=1;i<=10;i++){
       f=f*i;    //Even though i is int,changing f from int value to double value brigs a difference
       s=s+(double)(1/f);
       }
    System.out.println(s);

i have to find factorial of a number. What i found is that in the above code,if i change f from int to double,my answer is in decimal value but if i use int,my answer does not come to decimals.
Like in case of int- 2.0     in case of double-2.718281   as f is only multiplying inbt values,from where do the decimal values come?