title: Is there any benefit to using Math.Floor over explicit integer casting?
body: <p>Question is pretty straightforward, is there any benefit or difference? I've noticed that in C# the function returns a double without any decimal places, while in java it keeps the decimal places, but other than that the result is the same.</p>
  
  <p>Here is the code I used in Java and C#, and the output:</p>
  
  <pre><code>//Java                                        //C#
  
  double a = 5.5;                               double a = 5.5;
  System.out.println(Math.floor(a));            Console.WriteLine(Math.Floor(a));
  System.out.println((int)a);                   Console.WriteLine((int)a);
  
  //Output                                      //Output
  
  5.0                                           5
  5                                             5
  </code></pre>