C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML
And: This shows us that the Single type is the same as the float type, and the Double type is the same as the (lowercase) double type.
C# program that uses Single and Double
using System;
class Program
{
static void Main()
{
{
Single a = 1;
Double b = 1;
Console.WriteLine(a.GetType());
Console.WriteLine(b.GetType());
}
{
float a = 1;
double b = 1;
Console.WriteLine(a.GetType());
Console.WriteLine(b.GetType());
}
}
}
Output
System.Single
System.Double
System.Single
System.Double
Tip: Code written with float is less likely to confuse other programmers who might then introduce bugs.
Type information
float -> Single
double -> Double