Numeric variables
<< Click to Display Table of Contents >> Navigation: ThinBASIC Core Language > Data types and variables > Numeric variables |
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.22*(10^18) |
+9.22*(10^18) |
n/a |
|
|
|
|
|
|
||
Floating point data types |
SINGLE |
32 |
4 |
8.43*(10^-37) |
3.40*(10^38) |
6 |
DOUBLE |
64 |
8 |
-4.19*(10^-307) |
1.79*(10^308) |
16 |
|
EXTENDED (EXT) |
80 |
10 |
3.4*(10^-4932) |
1.2*(10^4932) |
18 |
|
CURRENCY |
64 |
8 |
-9.22*(10^14) |
+9.22*(10^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) |
DWordLong |
QUAD |