title: Inconsistency in divide-by-zero behavior between different value types
body: <p>Please consider the following code and comments:</p>
  
  <pre><code>Console.WriteLine(1 / 0); // will not compile, error: Division by constant zero
  
  int i = 0;
  Console.WriteLine(1 / i); // compiles, runs, throws: DivideByZeroException
  
  double d = 0;
  Console.WriteLine(1 / d); // compiles, runs, results in: Infinity   
  </code></pre>
  
  <p>I can understand the compiler actively checking for division by zero constant and the DivideByZeroException at runtime but:</p>
  
  <p>Why would using a double in a divide-by-zero return Infinity rather than throwing an exception? Is this by design or is it a bug?</p>
  
  <p>Just for kicks, I did this in VB.NET as well, with "more consistent" results:</p>
  
  <pre><code>dim d as double = 0.0
  Console.WriteLine(1 / d) ' compiles, runs, results in: Infinity
  
  dim i as Integer = 0
  Console.WriteLine(1 / i) '  compiles, runs, results in: Infinity
  
  Console.WriteLine(1 / 0) ' compiles, runs, results in: Infinity
  </code></pre>
  
  <p><strong>EDIT:</strong></p>
  
  <p>Based on kekekela's feedback I ran the following which resulted in infinity:</p>
  
  <pre><code>Console.WriteLine(1 / .0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001);
  </code></pre>
  
  <p>This test seems to corroborate the idea and a literal double of <code>0.0</code> is actually a very, very tiny fraction which will result in Infinity...</p>