Numeric variables
The following numeric data types are supported:
Group |
Data type |
Bits |
Bytes |
Range from |
Range to |
Digits of precision |
Integer data types |
BYTE |
8 |
1 |
0 |
255 |
n/a |
INTEGER |
16 |
2 |
-32768 |
32767 |
n/a |
|
WORD |
16 |
2 |
0 |
65535 |
n/a |
|
DWORD |
32 |
4 |
0 |
4294967295 |
n/a |
|
LONG |
32 |
4 |
-2147483648 |
2147483647 |
n/a |
|
QUAD |
64 |
8 |
-9.22x10^18 |
+9.22x10^18 |
n/a |
|
|
|
|
|
|
||
Floating point data types |
SINGLE |
32 |
4 |
8.43x10^-37 |
3.40x10^38 |
6 |
DOUBLE |
64 |
8 |
4.19x10^-307 |
1.79x10^308 |
16 |
|
EXTENDED (EXT) |
80 |
10 |
3.4x10^-4932 |
1.2x10^4932 |
18 |
|
CURRENCY |
64 |
8 |
-9.22x10^14 |
+9.22x10^14 |
4 |
Restrictions
1. | thinBasic perform all internal numeric calculations using EXTENDED (abbreviated EXT) data type. |
2. | due to lack of precision (only 6 digits), we suggest to use SINGLE data type only when interfacing to external libraries that explicitly ask for SINGLE parameters passed by reference. |
3. | Numeric data type is an alias of EXT (Extended) |
Numeric alias
In order to improve possibility to convert source code from/to other programming languages, thinBasic supports alias for floating point and integer numeric data types:
Alias |
Equivalent to thinBasic data type |
Int16 |
INTEGER |
UInt16 |
WORD |
UInt32 |
DWORD |
Int32 |
LONG |
Int64 |
QUAD |
LongLong |
QUAD |
Large_Integer |
QUAD |
|
|
Float32 |
SINGLE |
Float64 |
DOUBLE |
Float80 |
EXTENDED (EXT) |