Search Placementyogi.com
 

Floating-Point Data Types in C#.NET

A float-point data type is a numeric data type that can represent fractional values.

The below table provides the size, range and default values of floating-point data types.

Type Size(Bits) Range Default Value Data Suffix
float 32 -3.402823E38 to +3.402823E38 0.0F f, F
double 64 -1.79769313486232E308 to +1.79769313486232E308 0.0D d, D

 

Note: Type double is default float-pointing data type in C#. 

Example of Floating-Point Data Types in C#

float x = 1;   //valid
float x = 1.1  //invalid (By default 1.1 is double type)
float x = 1.1F //valid
double y = 1;  //valid
double y = 1.1 //valid
double y = 1.1D //valid
double y = 1.1F //valid (1.1F can be converted to double type)
Banner to LogicGuns.com

Hide Page Information

.NET Tutorial - Floating-Point Data Types in C#

Here you can find complete tutorial for all floating-point data types through easy learning.

In this section you can learn about floating-point data types in C# to improve your .NET skills in order to face the interviews, competitive examinations and various entrance tests with full confidence.

Where can I get .NET tutorials?

PlacementYogi provides tutorial on Floating-Point Data Types through easy learning process focusing interviews.

You can easily learn Floating-Point Data Types through our compact and best tutorials.