26 Datentypen PBXB64-Erweiterung
PBXB64 unterstützt alle Standard-PowerBASIC-Typen plus 6 neue Typen, die in keinem anderen PB-Compiler zu finden sind: DEC128 (18-Stellen-Dezimal), RATIONAL (exakte Arithmetik), VARIANT (COM-kompatibel), OBJECT (COM-Referenz), GUID (128-Bit-UUID) und 128/256/512-Bit breite Ganzzahlen.
Vollständige Typ-Referenz
| Typ | Größe | Beschreibung | Status |
|---|---|---|---|
BYTE | 8-Bit | Vorzeichenlose Ganzzahl (0-255) | Standard |
WORD | 16-Bit | Vorzeichenlose Ganzzahl (0-65535) | Standard |
INTEGER | 16-Bit | Vorzeichenbehaftete Ganzzahl (-32768 bis 32767) | Standard |
LONG | 64-Bit | Vorzeichenbehaftete Ganzzahl (PBXB64-Standard ist 64-Bit) | Standard |
DWORD | 32-Bit | Vorzeichenlose Ganzzahl | Standard |
QUAD | 64-Bit | Vorzeichenbehaftete Ganzzahl (Alias) | Standard |
SINGLE | 32-Bit | IEEE-754 Float | Standard |
DOUBLE | 64-Bit | IEEE-754 Double | Standard |
EXTENDED | 80-Bit | Erweiterte Präzision Float | Standard |
CURRENCY | 64-Bit | Festkomma (×10000) | Standard |
CURRENCYX | 16-Byte | Erweitertes Festkomma (V12) | NEU |
STRING | Dynamisch | ANSI variable Länge | Standard |
WSTRING | Dynamisch | Wide-Character (UTF-16) String | Standard |
STRINGZ | Dynamisch | Null-terminierter ANSI-String | NEU |
WSTRINGZ | Dynamisch | Null-terminierter Wide-String | NEU |
DEC128 | 16-Byte | Dezimales Festkomma, 18-Stellen-Präzision | NEU |
RATIONAL | 16-Byte | Exakte rationale Arithmetik (int64 Zähler/Nenner, auto-GGT) | NEU |
VARIANT | 16-Byte | COM-kompatibel (VT_I8, VT_R8, VT_BSTR) | NEU |
OBJECT | 8-Byte | COM-Objekt-Referenz | NEU |
GUID | 16-Byte | 128-Bit UUID | NEU |
128-Bit int | 16-Byte | Inline 128-Bit Arithmetik | NEU |
256-Bit int | 32-Byte | Inline 256-Bit Arithmetik | NEU |
512-Bit int | 64-Byte | Inline 512-Bit Arithmetik | NEU |
DEC128 - 18-Stellen-Dezimal-Präzision
PBXB64-Erweiterung Ein 16-Byte dezimales Festkomma-Typ mit 18-Stellen-Präzision. Ideal für finanzielle Berechnungen, bei denen binäre Gleitkomma-Rundungsfehler inakzeptabel sind.
DEC128 speichert Werte als Dezimalziffern, nicht als binäre Brüche. 19,99 + 0,01 ergibt exakt 20,00, nicht 19,999999999999996.
RATIONAL - Exakte Arithmetik
PBXB64-Erweiterung Speichert Zahlen als int64-Zähler/Nenner-Paare mit automatischer GGT-Normalisierung. 1/3 + 1/3 = 2/3 exakt. Keine Rundung, niemals.
RATIONAL reduziert Brüche automatisch (GGT-Normalisierung) und unterstützt alle Arithmetik-Operationen: +, -, *, /, Vergleich, Konvertierung zu/von DECIMAL/DOUBLE.
VARIANT - COM-kompatible Werte
PBXB64-Erweiterung Vollständige VARIANT-Implementierung mit VT_EMPTY, VT_I8, VT_R8, VT_CY, VT_BOOL, VT_BSTR. Unterstützt Skalar, feste Arrays und dynamische Arrays mit REDIM PRESERVE.
VARIANT-Arrays unterstützen elementweise Lebenszyklus-Verwaltung. REDIM PRESERVE führt tiefe Element-Kopien durch.
Breite Ganzzahlen - 128 / 256 / 512 Bit
PBXB64-Erweiterung Inline-Arithmetik auf 128, 256 und 512-Bit-Ganzzahlen. Keine Bibliotheksaufrufe, keine Heap-Allokation - reine Register-basierte Operationen.
Breite Ganzzahlen unterstützen Addition, Subtraktion, Multiplikation, Division, Vergleich und Bitweise Operationen. Alles inline im x64-Backend ohne externe Bibliotheken.
Probieren Sie es selbst
Alle Testdateien befinden sich in examples/basic/ - kompilieren und ausführen zum Verifizieren.