Dividing a Float by Zero, Displaying NaN : long Calculation « Data Type « C# / CSharp Tutorial






class MainClass
{
  static void Main()
  {
    float n=0f;
    System.Console.WriteLine(n / 0);
  }
}








2.13.long Calculation
2.13.1.Use long to compute the distance from the Earth to the sun in inches
2.13.2.Calculate with ulong
2.13.3.Overflowing the Bounds of a float
2.13.4.Dividing a Float by Zero, Displaying NaN