Overflowing the Bounds of a float : long Calculation « Data Type « C# / CSharp Tutorial






class MainClass
{
  static void Main()
  {
    System.Console.WriteLine(-1f / 0);
    System.Console.WriteLine(3.402823E+38f * 2f);
  }
}








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