Calculate with ulong : long Calculation « Data Type « C# / CSharp Tutorial






using System;

    class MainClass
    {
        static void Main(string[] args)
        {
            ulong loopCount = 0;
            ulong factorial = 1;
            loopCount = 23;
            for( ulong i = loopCount; i > 0; i-- )
            {
                factorial *= i;
            }
            Console.WriteLine( "{0}! = {1}", loopCount, factorial );

        }
    }








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