26 Data Types PBXB64 Additions
PBXB64 supports all standard PowerBASIC types plus 6 new types not found in any other PB compiler: DEC128 (18-digit decimal), RATIONAL (exact arithmetic), VARIANT (COM-compatible), OBJECT (COM reference), GUID (128-bit UUID), and 128/256/512-bit wide integers.
Complete Type Reference
| Type | Size | Description | Status |
|---|---|---|---|
BYTE | 8-bit | Unsigned integer (0-255) | Standard |
WORD | 16-bit | Unsigned integer (0-65535) | Standard |
INTEGER | 16-bit | Signed integer (-32768 to 32767) | Standard |
LONG | 64-bit | Signed integer (PBXB64 default is 64-bit) | Standard |
DWORD | 32-bit | Unsigned integer | Standard |
QUAD | 64-bit | Signed integer alias | Standard |
SINGLE | 32-bit | IEEE-754 float | Standard |
DOUBLE | 64-bit | IEEE-754 double | Standard |
EXTENDED | 80-bit | Extended precision float | Standard |
CURRENCY | 64-bit | Fixed-point (×10000) | Standard |
CURRENCYX | 16-byte | Extended fixed-point (V12) | NEW |
STRING | Dynamic | ANSI variable-length string | Standard |
WSTRING | Dynamic | Wide-character (UTF-16) string | Standard |
STRINGZ | Dynamic | Null-terminated ANSI string | NEW |
WSTRINGZ | Dynamic | Null-terminated wide string | NEW |
DEC128 | 16-byte | Decimal fixed-point, 18-digit precision | NEW |
RATIONAL | 16-byte | Exact rational (int64 num/den, auto-GCD) | NEW |
VARIANT | 16-byte | COM-compatible (VT_I8, VT_R8, VT_BSTR) | NEW |
OBJECT | 8-byte | COM object reference | NEW |
GUID | 16-byte | 128-bit UUID | NEW |
128-bit int | 16-byte | Inline 128-bit arithmetic | NEW |
256-bit int | 32-byte | Inline 256-bit arithmetic | NEW |
512-bit int | 64-byte | Inline 512-bit arithmetic | NEW |
DEC128 - 18-Digit Decimal Precision
PBXB64 Addition A 16-byte decimal fixed-point type with 18-digit precision. Ideal for financial calculations where binary floating-point rounding errors are unacceptable.
DEC128 stores values as decimal digits, not binary fractions. 19.99 + 0.01 equals exactly 20.00, not 19.999999999999996.
RATIONAL - Exact Arithmetic
PBXB64 Addition Stores numbers as int64 numerator/denominator pairs with automatic GCD normalization. 1/3 + 1/3 = 2/3 exactly. No rounding, ever.
RATIONAL automatically reduces fractions (GCD normalization) and supports all arithmetic operations: +, -, *, /, comparison, conversion to/from DECIMAL/DOUBLE.
VARIANT - COM-Compatible Values
PBXB64 Addition Full VARIANT implementation with VT_EMPTY, VT_I8, VT_R8, VT_CY, VT_BOOL, VT_BSTR. Supports scalar, fixed arrays, and dynamic arrays with REDIM PRESERVE.
VARIANT arrays support element-wise lifecycle management. REDIM PRESERVE performs deep element copy.
Wide Integers - 128 / 256 / 512 Bit
PBXB64 Addition Inline arithmetic on 128, 256, and 512-bit integers. No library calls, no heap allocation - pure register-based operations.
Wide integers support addition, subtraction, multiplication, division, comparison, and bitwise operations. All done inline in the x64 backend without external libraries.
Try It Yourself
All test files are in examples/basic/ - compile and run them to verify.