Skip to content

Commit e527c41

Browse files
committed
[rntuple] dummy read for kReal32Trunc, kReal32Quant, kReal16
1 parent 72b966f commit e527c41

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

modules/rntuple.mjs

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const kBit = 0x00,
1515
kUInt32 = 0x08,
1616
kInt64 = 0x09,
1717
kUInt64 = 0x0A,
18-
// kReal16 = 0x0B, not used yet
18+
kReal16 = 0x0B,
1919
kReal32 = 0x0C,
2020
kReal64 = 0x0D,
2121
kIndex32 = 0x0E,
@@ -32,8 +32,8 @@ const kBit = 0x00,
3232
kSplitReal64 = 0x19,
3333
kSplitIndex32 = 0x1A,
3434
kSplitIndex64 = 0x1B,
35-
// kReal32Trunc = 0x1C, not used yet
36-
// kReal32Quant = 0x1D, not used yet
35+
kReal32Trunc = 0x1C,
36+
kReal32Quant = 0x1D,
3737
LITTLE_ENDIAN = true;
3838

3939
class RBufferReader {
@@ -850,6 +850,21 @@ class ReaderItem {
850850
};
851851
this.sz = 4;
852852
break;
853+
case kReal16:
854+
this.func = function(obj) {
855+
obj[this.name] = this.view.getUint16(this.o, LITTLE_ENDIAN);
856+
this.shift_o(2);
857+
};
858+
this.sz = 2;
859+
break;
860+
case kReal32Trunc:
861+
case kReal32Quant:
862+
this.func = function(obj) {
863+
obj[this.name] = this.view.getUint32(this.o, LITTLE_ENDIAN);
864+
this.shift_o(4);
865+
};
866+
this.sz = 4;
867+
break;
853868
case kInt64:
854869
case kIndex64:
855870
this.func = function(obj) {

0 commit comments

Comments
 (0)