Difference between revisions of "Template:DataTypeTable"

From QB64 Wiki
Jump to navigation Jump to search
imported>Clippy
m
 
(14 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{| border="0" cellpadding="0" cellspacing="0"
+
 
|-
+
'''Numerical types'''
|
+
 
{| border="1" cellpadding="2" width="100%"
+
{| class="wikitable"
|-
+
!  Type Name !! Type suffix symbol !! Minimum value !! Maximum value !! Size in Bytes
! colspan="5" | Numeric types
 
 
|-
 
|-
! Name || Type suffix symbol || Minimum value || Maximum value || Size (in bits)
+
| _BIT                    || ||                       -1 ||                         0 || 1/8
 
|-
 
|-
| align="center" | [[_BIT]]                    || align="center" | `  || align="right" |                      -1 || align="right" |                        0 || align="center" | 1
+
| _BIT|_BIT * n            || `n ||                       -128 ||                         127 ||   n/8
 
|-
 
|-
| align="center" | [[_BIT|_BIT * n]]            || align="center" | `n || align="right" |                       -128 || align="right" |                        127 || align="center" | up to 8
+
| _UNSIGNED _BIT     || ~`  ||                       0 ||                         1 || 1/8
 
|-
 
|-
| align="center" | [[_UNSIGNED]] [[_BIT]]      || align="center" | ~` || align="right" |                       0 || align="right" |                        1 || align="center" | 1
+
| _BYTE                    || %% ||                       -128 ||                         127 || 1
 
|-
 
|-
| align="center" | [[_BYTE]]                    || align="center" | %% || align="right" |                      -128 || align="right" |                       127 || align="center" | 8
+
| _UNSIGNED _BYTE     || ~%% ||                           0 ||                         255 || 1
 
|-
 
|-
| align="center" | [[_UNSIGNED]] [[_BYTE]]      || align="center" | ~%% || align="right" |                          0 || align="right" |                       255 || align="center" | 8
+
| INTEGER                  || %   ||                     -32,768 ||                     32,767 || 2
 
|-
 
|-
| align="center" | [[INTEGER]]                  || align="center" | %   || align="right" |                   -32,768 || align="right" |                     32,767 || align="center" | 16
+
| _UNSIGNED INTEGER   || ~% ||                           0 ||                     65,535 || 2
 
|-
 
|-
| align="center" | [[_UNSIGNED]] [[INTEGER]]    || align="center" | ~%  || align="right" |                          0 || align="right" |                    65,535 || align="center" | 16
+
| LONG                    || ||             -2,147,483,648 ||               2,147,483,647 || 4
 
|-
 
|-
| align="center" | [[LONG]]                    || align="center" | &   || align="right" |             -2,147,483,648 || align="right" |             2,147,483,647 || align="center" | 32
+
| _UNSIGNED LONG       || ~& ||                           0 ||               4,294,967,295 || 4
 
|-
 
|-
| align="center" | [[_UNSIGNED]] [[LONG]]      || align="center" | ~&  || align="right" |                         0 || align="right" |              4,294,967,395 || align="center" | 32
+
| _INTEGER64              || &&  || -9,223,372,036,854,775,808 || 9,223,372,036,854,775,807 || 8
 
|-
 
|-
| align="center" | [[_INTEGER64]]              || align="center" | && || align="right" | -9,223,372,036,854,775,808 || align="right" | 9,223,372,036,854,775,807 || align="center" | 64
+
| _UNSIGNED _INTEGER64 || ~&& ||                           0 || 18,446,744,073,709,551,615 || 8
 
|-
 
|-
| align="center" | [[_UNSIGNED]] [[_INTEGER64]] || align="center" | ~&& || align="right" |                         0 || align="right" | 18,446,744,073,709,551,615 || align="center" | 64
+
| SINGLE                  || ! or none  ||               -2.802597E-45 ||               +3.402823E+38 || 4
 
|-
 
|-
| align="center" | [[SINGLE]]                   || align="center" | !   || align="right" |              ±2.802597E-45 || align="right" |              ±3.402823E+38 || align="center" | 32
+
| DOUBLE                   || #   ||     -4.490656458412465E-324 ||     +1.797693134862310E+308 || 8
 
|-
 
|-
| align="center" | [[DOUBLE]]                   || align="center" | #   || align="right" |    ±4.490656458412465E-324 || align="right" |    ±1.797693134862310E+308 || align="center" | 64
+
| _FLOAT                   || #||                 -1.18E−4932 ||                 +1.18E+4932 || 32(10 used)
 
|-
 
|-
| align="center" | [[_FLOAT]]                   || align="center" | ## || align="right" |               ±1.18E−4932 || align="right" |                ±1.18E+4932 || align="center" | 256(80 used)
+
| _OFFSET                   || %& ||                 -9,223,372,036,854,775,808  || 9,223,372,036,854,775,807 || Use LEN
 
|-
 
|-
| align="center" | [[_OFFSET]]                  || align="center" | %&  || align="right" |                -9,223,372,036,854,775,808 || align="right" | 9,223,372,036,854,775,807 || align="center" | Use [[LEN]]
+
| _UNSIGNED _OFFSET     || ~%&  ||                 0 || 18,446,744,073,709,551,615 || Use LEN
 
|-
 
|-
| align="center" | [[_UNSIGNED]] [[_OFFSET]]    || align="center" | %&  || align="right" |                0  || align="right" | 18,446,744,073,709,551,615 || align="center" | Use [[LEN]]
+
| _MEM                  || none  ||             combined memory variable type ||       N/A || Use LEN
|-
 
| align="center" | [[_MEM]]                   || align="center" | none  || align="right" |            combined memory variable type || align="right" |      N/A || align="center" | Use [[LEN]]
 
 
|}
 
|}
|-
 
|  
 
|-
 
|
 
:''Note: For the floating-point numeric types [[SINGLE]], [[DOUBLE]] and [[_FLOAT]], the minimum values represent the smallest values closest to zero, while the maximum values represent the largest values closest to ±infinity.''
 
  
  
{| border="1" cellpadding="2" width="100%"
+
:''Note: For the floating-point numeric types [[SINGLE]] (default when not assigned), [[DOUBLE]] and [[_FLOAT]], the minimum values represent the smallest values closest to zero, while the maximum values represent the largest values closest to ±infinity. OFFSET dot values are used as a part of the [[_MEM]] variable type in QB64 to return or set the position in memory.''
|-
+
 
! colspan="4" | String type
+
 
 +
'''String text type'''
 +
{| class="wikitable"
 +
!       Type Name      !! Type suffix symbol !! Minimum length !! Maximum length || Size in Bytes
 
|-
 
|-
! Name || Type suffix symbol || Minimum length || Maximum length
+
|           STRING                || $ ||            0 ||                2,147,483,647  || Use LEN
 
|-
 
|-
| align="center" | [[STRING]]                  || align="center" | $      || align="right" | 0 || align="right" | 2,147,483,647
+
|         STRING|STRING * ''n''            || $''n'' ||         1 ||       2,147,483,647 || n
|-
 
| align="center" | [[STRING|STRING * ''n'']]             || align="center" | $''n'' || align="right" | 1 || align="right" | 2,147,483,647
 
|}
 
 
|}
 
|}
  
  
 
<center>''Note: For the fixed-length string type [[STRING|STRING * ''n'']], where ''n'' is an integer length value from 1 (one) to 2,147,483,647.</center>
 
<center>''Note: For the fixed-length string type [[STRING|STRING * ''n'']], where ''n'' is an integer length value from 1 (one) to 2,147,483,647.</center>

Latest revision as of 19:57, 24 January 2021

Numerical types

 Type Name Type suffix symbol Minimum value Maximum value Size in Bytes
_BIT ` -1 0 1/8
_BIT * n `n -128 127 n/8
_UNSIGNED _BIT ~` 0 1 1/8
_BYTE %% -128 127 1
_UNSIGNED _BYTE ~%% 0 255 1
INTEGER % -32,768 32,767 2
_UNSIGNED INTEGER ~% 0 65,535 2
LONG & -2,147,483,648 2,147,483,647 4
_UNSIGNED LONG ~& 0 4,294,967,295 4
_INTEGER64 && -9,223,372,036,854,775,808 9,223,372,036,854,775,807 8
_UNSIGNED _INTEGER64 ~&& 0 18,446,744,073,709,551,615 8
SINGLE ! or none -2.802597E-45 +3.402823E+38 4
DOUBLE # -4.490656458412465E-324 +1.797693134862310E+308 8
_FLOAT ## -1.18E−4932 +1.18E+4932 32(10 used)
_OFFSET %& -9,223,372,036,854,775,808 9,223,372,036,854,775,807 Use LEN
_UNSIGNED _OFFSET ~%& 0 18,446,744,073,709,551,615 Use LEN
_MEM none combined memory variable type N/A Use LEN


Note: For the floating-point numeric types SINGLE (default when not assigned), DOUBLE and _FLOAT, the minimum values represent the smallest values closest to zero, while the maximum values represent the largest values closest to ±infinity. OFFSET dot values are used as a part of the _MEM variable type in QB64 to return or set the position in memory.


String text type

      Type Name       Type suffix symbol Minimum length Maximum length Size in Bytes
STRING $            0               2,147,483,647 Use LEN
STRING * n $n         1       2,147,483,647 n


Note: For the fixed-length string type STRING * n, where n is an integer length value from 1 (one) to 2,147,483,647.