System Types Real Number Properties C# with Example

System Types Real Number Properties C# with Example

 using System;

namespace CSharpFundamentals
    class SystemTypesRealNumberProperties
        private static void Main(string[] args)
			Console.WriteLine("Min of float: {0}", float.MinValue);
			Console.WriteLine("Max of float: {0}", float.MaxValue);
			Console.WriteLine("Epsilon of float: {0}", float.Epsilon);
			Console.WriteLine("NegativeInfinity of float: {0}", float.NegativeInfinity);
			Console.WriteLine("PositiveInfinity of float: {0}\n", float.PositiveInfinity);

			Console.WriteLine("Min of double: {0}", double.MinValue);
			Console.WriteLine("Max of double: {0}", double.MaxValue);
			Console.WriteLine("Epsilon of double: {0}", double.Epsilon);
			Console.WriteLine("NegativeInfinity of double: {0}", double.NegativeInfinity);
			Console.WriteLine("PositiveInfinity of double: {0}\n", double.PositiveInfinity);
			Console.WriteLine("Min of decimal: {0}", decimal.MinValue);		
			Console.WriteLine("Max of decimal: {0}", decimal.MaxValue);
			Console.WriteLine("MinusOne of decimal: {0}", decimal.MinusOne);
			Console.WriteLine("One of decimal: {0}", decimal.One);
			Console.WriteLine("Zero of decimal: {0}\n", decimal.Zero);

0 Comment's

Comment Form