Double.GetTypeCode() Method in C#


The Double.GetTypeCode() method in C# is used to return the TypeCode for value type Double.

Syntax

The syntax is as follows −

public TypeCode GetTypeCode ();

Example

Let us now see an example −

 Live Demo

using System;
public class Demo {
   public static void Main() {
      double d = 15d;
      Console.WriteLine("Double Value = "+d);
      Console.WriteLine("HashCode of Double Value = "+d.GetHashCode());
      TypeCode type = d.GetTypeCode();
      Console.WriteLine("TypeCode of Double Value = "+type);
   }
}

Output

This will produce the following output −

Double Value = 15
HashCode of Double Value = 1076756480
TypeCode of Double Value = Double

Example

Let us now see another example −

 Live Demo

using System;
public class Demo {
   public static void Main() {
      double d = 25.5d;
      Console.WriteLine("Double Value = "+d);
      Console.WriteLine("HashCode of Double Value = "+d.GetHashCode());
      TypeCode type = d.GetTypeCode();
      Console.WriteLine("TypeCode of Double Value = "+type);
   }
}

Output

This will produce the following output −

Double Value = 25.5
HashCode of Double Value = 1077510144
TypeCode of Double Value = Double
raja
Published on 04-Dec-2019 11:08:01
Advertisements