From 319c90e45fc96ba6f15edcf00b24e484d9d92f2b Mon Sep 17 00:00:00 2001
From: Norbert Preining <norbert@preining.info>
Date: Fri, 4 Aug 2023 03:01:07 +0000
Subject: CTAN sync 202308040301

---
 macros/luatex/latex/luamaths/luamaths.sty | 24 +++++++++++++++++++-----
 1 file changed, 19 insertions(+), 5 deletions(-)

(limited to 'macros/luatex/latex/luamaths/luamaths.sty')

diff --git a/macros/luatex/latex/luamaths/luamaths.sty b/macros/luatex/latex/luamaths/luamaths.sty
index c3bc4d51e0..524b36a210 100644
--- a/macros/luatex/latex/luamaths/luamaths.sty
+++ b/macros/luatex/latex/luamaths/luamaths.sty
@@ -1,19 +1,25 @@
-% luaset package
-% version 1.0
-% Authors: Chetan Shirore and Ajit Kumar
+% The luamaths package
+% 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{luaset}[1.0]
+\ProvidesPackage{luamaths}[1.1]
 \RequirePackage{xkeyval}
 \RequirePackage{amsmath}
 \RequirePackage{luacode}
 \begin{luacode*}
+local complex = require "luamaths-complex"
+local lfrac = require "luamaths-fractions"
+
 function mathop(...)
 inf = math.huge
 return ...
 end
 
 function mathround(num, numDecimalPlaces)
+    if num==math.floor(num) then
+     return math.floor(num)
+    end
   local mult = 10^(numDecimalPlaces or 0)
   return math.floor(num * mult + 0.5) / mult
 end
@@ -27,7 +33,7 @@ end
 \newcommand\mathCos[1]{\directlua{tex.sprint(math.cos(#1))}}
 \newcommand\mathExp[1]{\directlua{tex.sprint(math.exp(#1))}}
 \newcommand\mathFloor[1]{\directlua{tex.sprint(math.floor(#1))}}
-\newcommand\mathHuge{\directlua{tex.sprint(math.huge)}}
+\newcommand\mathInf{\directlua{tex.sprint(math.huge)}}
 \newcommand\mathLog[1]{\directlua{tex.sprint(math.log(#1))}}
 \newcommand\mathMax[1]{\directlua{tex.sprint(math.max(#1))}}
 \newcommand\mathMin[1]{\directlua{tex.sprint(math.min(#1))}}
@@ -38,4 +44,12 @@ end
 \newcommand\mathTan[1]{\directlua{tex.sprint(math.tan(#1))}}
 \newcommand\mathRad[1]{\directlua{tex.sprint(math.rad(#1))}}
 \newcommand\mathRound[2]{\directlua{tex.sprint(mathround(#1,#2))}}
+\newcommand\complexRound[2]{%
+\directlua{%
+tex.sprint(complex.tostring(complex.round(#1,#2)))
+}%
+}%
+\newcommand{\imUnit}{\mathrm{i}}
+ 
+
 \endinput
-- 
cgit v1.2.3

