We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
s8
1 parent ff3a347 commit 661246eCopy full SHA for 661246e
KaitaiStream.js
@@ -221,7 +221,7 @@ KaitaiStream.prototype.readS8be = function() {
221
if ((v1 & 0x80000000) !== 0) {
222
var p1 = v1 ^ 0xffffffff;
223
var p2 = v2 ^ 0xffffffff;
224
- var p3 = 0x100000000 * p1 + p2;
+ var p3 = 0x100000000 * (p1 + 1) + p2;
225
226
// negative number
227
return -p3 - 1;
@@ -271,7 +271,7 @@ KaitaiStream.prototype.readS8le = function() {
271
if ((v2 & 0x80000000) !== 0) {
272
273
274
- var p3 = 0x100000000 * p2 + p1;
+ var p3 = 0x100000000 * (p2 + 1) + p1;
275
276
277
0 commit comments