diff options
author | Karl Berry <karl@freefriends.org> | 2023-11-18 20:57:26 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2023-11-18 20:57:26 +0000 |
commit | 26d6f3fd916b1baebe24ab80e72212299d4f42fd (patch) | |
tree | 3c9f422f4caf0b4cfc592242ceaab00ab5fecab4 /Master/texmf-dist/tex | |
parent | 20a29963ee878b99f56b77e7e8b62ff9e6fcf10c (diff) |
luagcd, luamodulartables, luatruthtable (18nov23)
git-svn-id: svn://tug.org/texlive/trunk@68893 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
3 files changed, 19 insertions, 17 deletions
diff --git a/Master/texmf-dist/tex/lualatex/luagcd/luagcd.sty b/Master/texmf-dist/tex/lualatex/luagcd/luagcd.sty index 12a5106ac34..6f2e64aaf17 100644 --- a/Master/texmf-dist/tex/lualatex/luagcd/luagcd.sty +++ b/Master/texmf-dist/tex/lualatex/luagcd/luagcd.sty @@ -1,12 +1,12 @@ % luagcd package -% version 1.0 +% version 1.1 % Licensed under LaTeX Project Public License v1.3c or later. The complete license text is available at http://www.latex-project.org/lppl.txt. % Authors: Chetan Shirore and Ajit Kumar -\ProvidesPackage{luagcd}[1.0] +\ProvidesPackage{luagcd}[1.1] \RequirePackage{luacode} \begin{luacode*} -function findgcd2(a,b) +function findgcd2(a,b) -- function to find gcd of 2 numbers. a = math.abs(a) b = math.abs(b) if b ~= 0 then @@ -16,7 +16,7 @@ function findgcd2(a,b) end end -function findgcd(...) +function findgcd(...) -- function to find gcd of 2 or more numbers. local tbl = table.pack(...) if #(tbl) > 2 then local rem = table.remove(tbl,1) @@ -27,7 +27,7 @@ function findgcd(...) end end -function inputcheck ( ... ) +function inputcheck ( ... ) -- validating input. local tbl = table.pack(...) for _, v in ipairs(tbl) do if type(v) ~= 'number' then @@ -39,14 +39,14 @@ function inputcheck ( ... ) end end end - -function luagcd(...) +- function to find gcd with input validatiion. +function luagcd(...) - inputcheck(...) return findgcd(...) end - -function stepbystepgcd(a,b,sep) +-- function to find gcd of 2 numbers with steps. +function stepbystepgcd(a,b,sep) if type(a) ~= 'number' or type(b) ~= 'number' then error('Only numbers are expected.') return @@ -100,7 +100,7 @@ end " is the last non-zero remainder and it is " ..t.. "." end end - +-- function to express gcd of 2 numbers as an integer linear combination. function lincombgcd (a,b) local val1,val2 = a,b if type(a) ~= 'number' or type(b) ~= 'number' then @@ -200,7 +200,7 @@ return ("The gcd of " .. val1 .." and " .. val2 .. " is " .. gcd .. " and the equation $" .. coeff1 .."x" .. op .. coeff2 .."y = " ..gcd .. "$ has a solution $(x,y) = (" .. e_3 .. "," .. f_3 ..")$.") end - +-- function to express gcd of 2 numbers as an integer linear combination with steps. function lincombgcdstepbystep (a,b) local val1,val2 = a,b if type(a) ~= 'number' or type(b) ~= 'number' then diff --git a/Master/texmf-dist/tex/lualatex/luamodulartables/luamodulartables.sty b/Master/texmf-dist/tex/lualatex/luamodulartables/luamodulartables.sty index 6e43c97bf09..0858c00bc87 100644 --- a/Master/texmf-dist/tex/lualatex/luamodulartables/luamodulartables.sty +++ b/Master/texmf-dist/tex/lualatex/luamodulartables/luamodulartables.sty @@ -1,5 +1,5 @@ -% luamodulartables -% version 1.0 +% The luamodulartables package. +% version 1.1 % Authors: Chetan Shirore and Ajit Kumar % Licensed under LaTeX Project Public License v1.3c or later. The complete license text is available at http://www.latex-project.org/lppl.txt. @@ -7,6 +7,7 @@ \RequirePackage{xkeyval} \RequirePackage{luacode} \begin{luacode*} +-- Defining function for modular multiplication. function modulomult(n,label, headline, midline) label = label or '$\\times$' headline = headline or '' @@ -33,7 +34,7 @@ function modulomult(n,label, headline, midline) end return (str2) end - +-- Defining function for modular addition. function moduloadd(n,label, headline, midline) label = label or '$+$' headline = headline or '' diff --git a/Master/texmf-dist/tex/lualatex/luatruthtable/luatruthtable.sty b/Master/texmf-dist/tex/lualatex/luatruthtable/luatruthtable.sty index c839b98700c..a3a44818596 100644 --- a/Master/texmf-dist/tex/lualatex/luatruthtable/luatruthtable.sty +++ b/Master/texmf-dist/tex/lualatex/luatruthtable/luatruthtable.sty @@ -1,13 +1,14 @@ % The luatruthtable package % Authors: Chetan Shirore and Ajit Kumar -% Version 1.2, Date=15-Aug-2023 +% Version 1.3, Date=17-Nov-2023 % Licensed under LaTeX Project Public License v1.3c or later. The complete license text is available at http://www.latex-project.org/lppl.txt. -\ProvidesPackage{luatruthtable}[1.2] +\ProvidesPackage{luatruthtable}[1.3] \RequirePackage{xkeyval} \RequirePackage{amsmath} \RequirePackage{luacode} \begin{luacode*} +-- Function to convert decimal number to binary number. local function toBinary(x,y) y = y or math.max(1, select(2, math.frexp(x))) local res = {} @@ -17,7 +18,7 @@ local function toBinary(x,y) end return res end - +-- Define logical operators. local function _not(a) if a ==0 then return 1 else return 0 end |