Floating Point Special Values C# with Example



Floating Point Special Values C# with Example

 using System;

namespace CSharpFundamentals
{
    class FloatingPointSpecialValues
    {
        private static void Main(string[] args)
        {
			Console.WriteLine("float.NegativeInfinity: {0}", float.NegativeInfinity);
			Console.WriteLine("float.PositiveInfinity: {0}", float.PositiveInfinity);
			Console.WriteLine("float.NaN: {0}\n", float.NaN);
			
			Console.WriteLine("-0.0: {0}\n", -0.0);
			
			Console.WriteLine("double.NegativeInfinity: {0}", double.NegativeInfinity);
			Console.WriteLine("double.PositiveInfinity: {0}", double.PositiveInfinity);
			Console.WriteLine("double.NaN: {0}", double.NaN);
        }
    }
}
 

0 Comment's

Comment Form

Submit Comment