OSDN Git Service

a//b -> floor(a/b), since '//' does not produce integer always
authorHironori Kitagawa <h_kitagawa2001@yahoo.co.jp>
Wed, 24 Aug 2022 01:20:25 +0000 (10:20 +0900)
committerHironori Kitagawa <h_kitagawa2001@yahoo.co.jp>
Wed, 24 Aug 2022 01:20:25 +0000 (10:20 +0900)
src/ltj-charrange.lua
src/luatexja.lua

index b5207ce..074ba3c 100644 (file)
@@ -32,7 +32,7 @@ do
    end
 end
 for i = 31, 31*ATTR_RANGE-1 do
-   local ka, pw = luatexbase.attributes['ltj@kcat'..(i//31)], 2^(i%31)
+   local ka, pw = luatexbase.attributes['ltj@kcat'..floor(i/31)], 2^(i%31)
    kcat_attr_table[i], pow_table[i] = ka, pw
    fn_table[i] = function(p) return (get_attr(p, ka) or 0)&pw==0 end
    nfn_table[i] = function(p) return (get_attr_node(p, ka) or 0)&pw==0 end
index 8134976..54838de 100644 (file)
@@ -164,11 +164,11 @@ local floor = math.floor
 local function print_scaled(s)
    local out, delta = '', 10
    if s<0 then s, out = -s, out..'-' end
-   out=out..tostring(s//65536) .. '.'
+   out=out..tostring(floor(s/65536)) .. '.'
    s=10*(s%65536)+5
    repeat
       if delta>65536 then s=s+32768-50000 end
-      out=out .. tostring(s//65536)
+      out=out .. tostring(floor(s/65536))
       s=10*(s%65536); delta=delta*10
    until s<=delta
    return out