|
| 1 | +--- |
| 2 | +title: Basic Types (F#) |
| 3 | +description: Discover the fundamental basic types that are used in the F# language. |
| 4 | +ms.date: 07/09/2018 |
| 5 | +--- |
| 6 | +# Basic types |
| 7 | + |
| 8 | +This topic lists the basic types that are defined in the F# language. These types are the most fundamental in F#, forming the basis of nearly every F# program. They are a superset of .NET primitive types. |
| 9 | + |
| 10 | +|Type|.NET type|Description| |
| 11 | +|----|---------|-----------| |
| 12 | +|`bool`|<xref:System.Boolean>|Possible values are `true` and `false`.| |
| 13 | +|`byte`|<xref:System.Byte>|Values from 0 to 255.| |
| 14 | +|`sbyte`|<xref:System.SByte>|Values from -128 to 127.| |
| 15 | +|`int16`|<xref:System.Int16>|Values from -32768 to 32767.| |
| 16 | +|`uint16`|<xref:System.UInt16>|Values from 0 to 65535.| |
| 17 | +|`int`|<xref:System.Int32>|Values from -2,147,483,648 to 2,147,483,647.| |
| 18 | +|`uint32`|<xref:System.UInt32>|Values from 0 to 4,294,967,295.| |
| 19 | +|`int64`|<xref:System.Int64>|Values from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807.| |
| 20 | +|`uint64`|<xref:System.UInt64>|Values from 0 to 18,446,744,073,709,551,615.| |
| 21 | +|`nativeint`|<xref:System.IntPtr>|A native pointer as a signed integer.| |
| 22 | +|`unativeint`|<xref:System.UIntPtr>|A native pointer as an unsigned integer.| |
| 23 | +|`char`|<xref:System.Char>|Unicode character values.| |
| 24 | +|`string`|<xref:System.String>|Unicode text.| |
| 25 | +|`decimal`|<xref:System.Decimal>|A floating point data type that has at least 28 significant digits.| |
| 26 | +|`unit`|not applicable|Indicates the absence of an actual value. The type has only one formal value, which is denoted `()`. The unit value, `()`, is often used as a placeholder where a value is needed but no real value is available or makes sense.| |
| 27 | +|`void`|<xref:System.Void>|Indicates no type or value.| |
| 28 | +|`float32`, `single`|<xref:System.Single>|A 32-bit floating point type.| |
| 29 | +|`float`, `double`|<xref:System.Double>|A 64-bit floating point type.| |
| 30 | + |
| 31 | +>[!NOTE] |
| 32 | +You can perform computations with integers too big for the 64-bit integer type by using the [bigint](https://msdn.microsoft.com/library/dc8be18d-4042-46c4-b136-2f21a84f6efa) type. `bigint` is not considered a basic type; it is an abbreviation for `System.Numerics.BigInteger`. |
| 33 | + |
| 34 | +## See also |
| 35 | +[F# Language Reference](index.md) |
0 commit comments