diff options
author | Hans Hagen <pragma@wxs.nl> | 2017-03-02 23:00:09 +0100 |
---|---|---|
committer | Context Git Mirror Bot <phg42.2a@gmail.com> | 2017-03-02 23:00:09 +0100 |
commit | 8f5c555274eb48fcaaa3d7f340ee77710846fb7e (patch) | |
tree | 7e1802669127ba84d78ba62534f34e556b5c6e59 /tex/context/base/mkiv/util-sac.lua | |
parent | 6c9a5085dc2cee2c277d69d2dfcb397dab7aeb19 (diff) | |
download | context-8f5c555274eb48fcaaa3d7f340ee77710846fb7e.tar.gz |
2017-03-02 22:28:00
Diffstat (limited to 'tex/context/base/mkiv/util-sac.lua')
-rw-r--r-- | tex/context/base/mkiv/util-sac.lua | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/tex/context/base/mkiv/util-sac.lua b/tex/context/base/mkiv/util-sac.lua index 1a52bfc58..ccdb162d4 100644 --- a/tex/context/base/mkiv/util-sac.lua +++ b/tex/context/base/mkiv/util-sac.lua @@ -190,20 +190,17 @@ end if extract then + + local extract = bit32.extract + local band = bit32.band + function streams.read2dot14(f) local i = f[2] local j = i + 1 f[2] = j + 1 local a, b = byte(f[1],i,j) local n = 0x100 * a + b - local m = extract(n,0,30) - if n > 0x7FFF then - n = extract(n,30,2) - return m/0x4000 - 4 - else - n = extract(n,30,2) - return n + m/0x4000 - end + return extract(n,14,2) + (band(n,0x3FFF) / 16384.0) end end |