Skip to content

Standard Data Type Limits


Standard variable types and limits.

Numeric Types

TypeSize in bitsFormatMinimum ValueMaximum ValueLiteral SuffixSig. Digits
BYTE8signed integer-128+1272+
UBYTE8unsigned integer0+2552+
SHORT16signed integer-32768+327674+
USHORT16unsigned integer0655354+
LONG32signed integer-2147483648+2147483647&, l9+
ULONG32unsigned integer0+4294967295ul9+
INTEGER32/64 [*]signed integer[*]32bit: -2147483648, 64bit: -9223372036854775808[*]32bit: +2147483647, 64bit: +9223372036854775807%[*]
UINTEGER32/64 [*]unsigned integer0[*]32bit: +4294967295, 64bit: +18446744073709551615u[*]
LONGINT64signed integer-9223372036854775808+9223372036854775807ll18+
ULONGINT64unsigned integer0+18446744073709551615ull19+
SINGLE32floating point[**]+/-1.401 298 E-45[**]+/-3.402 823 E+38!, f6+
DOUBLE64floating point[**]+/-4.940 656 458 412 465 E-324[**]+/-1.797 693 134 862 316 E+308#, d15+
enums32/64 [*]signed integer[*]32bit: -2147483648, 64bit: -9223372036854775808[*]32bit: +2147483647, 64bit: +9223372036854775807[*]
  • [*] Integer and UInteger data types vary with platform, matching the size of pointers.
  • [**] The minimum and maximum values for the floating-point types Single and Double are, respectively, the values closest to zero and the values closest to positive and negative infinity.

String Types

TypeCharacter Size (in bytes)Minimum Size (in characters)Maximum Size (in characters), including terminating paddingLiteral Suffix
String10[**]32bit: +2147483647, 64bit: +9223372036854775807$
String*N11[,*]+2147483647$
Zstring*N11[,*]+2147483647[N/A]
Wstring*N[*][*]1[,,]+2147483647[N/A]
  • [*] Unicode, or "wide", characters vary in both size and availability with platform.
  • [**] All runtime library string procedures take and produce Integer values for sizes and positions. The actual maximum size will vary (smaller) with storage location and/or platform.
  • [***] Before fbc version 1.20.0, fixed-length strings had the same maximum size limits as variable strings.

Boolean Type

TypeInternal size in bitsValue
Boolean1-bit wide data (in a Byte)'False' or 'True'

Arrays

PlatformMaximum Subscript RangeMaximum Elements per DimensionMinimum/Maximum DimensionsMaximum Size (in bytes)
32bit[*][-2147483648, +2147483647][*]+21474836471/8[*]+2147483647
64bit[*][-9223372036854775808, +9223372036854775807][*]+92233720368547758071/8[*]+9223372036854775807
  • [*] All runtime library array procedures take and produce Integer values for subscripts and indexes. The actual limits will vary (smaller) with the number of dimensions, element size, storage location and/or platform.

UDTs

PlatformMaximum Size (in bytes)
32bit[*]+2147483647
64bit[*]+2147483647
  • [*] The actual maximum size will vary (smaller) with storage location and/or platform.

See also

Usage of suffixes for variables

Usage of suffixes for literals / numbers

Back to DocToc

Translated from FreeBASIC official docs. Contact us for removal if infringed.
FreeBASIC is an open-source project, not affiliated with Microsoft