summaryrefslogtreecommitdiff
path: root/tex/context/base/l-number.lua
diff options
context:
space:
mode:
authorMarius <mariausol@gmail.com>2012-06-25 15:20:28 +0300
committerMarius <mariausol@gmail.com>2012-06-25 15:20:28 +0300
commite845f69d0b63d95ffc66a0085756c84f71a495a0 (patch)
treec3150fa85e89c509abbc7ce32464e1da71f1dc37 /tex/context/base/l-number.lua
parent912801570b5d1555011b220ecb938143cc32b707 (diff)
downloadcontext-e845f69d0b63d95ffc66a0085756c84f71a495a0.tar.gz
beta 2012.06.25 14:10
Diffstat (limited to 'tex/context/base/l-number.lua')
-rw-r--r--tex/context/base/l-number.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/tex/context/base/l-number.lua b/tex/context/base/l-number.lua
index b1ffb9ca9..301380eee 100644
--- a/tex/context/base/l-number.lua
+++ b/tex/context/base/l-number.lua
@@ -72,11 +72,11 @@ function number.hasbit(x, p) -- typical call: if hasbit(x, bit(3)) then ...
end
function number.setbit(x, p)
- return hasbit(x, p) and x or x + p
+ return (x % (p + p) >= p) and x or x + p
end
function number.clearbit(x, p)
- return hasbit(x, p) and x - p or x
+ return (x % (p + p) >= p) and x - p or x
end
--~ function number.tobitstring(n)