[latex3-commits] [l3svn] 01/02: Add \inteval to xfp

noreply at latex-project.org noreply at latex-project.org
Sun Aug 6 19:35:09 CEST 2017


This is an automated email from the git hooks/post-receive script.

joseph pushed a commit to branch master
in repository l3svn.

commit 5409da13d5d770082bc9b7b387185ab11d720491
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Sun Aug 6 10:22:33 2017 +0100

    Add \inteval to xfp
---
 l3packages/xfp/xfp.dtx |   24 +++++++++++++++++++++++-
 1 file changed, 23 insertions(+), 1 deletion(-)

diff --git a/l3packages/xfp/xfp.dtx b/l3packages/xfp/xfp.dtx
index 1b0a606..930bec8 100644
--- a/l3packages/xfp/xfp.dtx
+++ b/l3packages/xfp/xfp.dtx
@@ -69,7 +69,8 @@
 % \begin{documentation}
 %
 % This package provides a \LaTeXe{} document-level interface to the \LaTeX{}3
-% floating point unit (part of \pkg{expl3}).
+% floating point unit (part of \pkg{expl3}). It also provides a parallel
+% integer expression interface for convenience.
 % 
 % \begin{function}[EXP]{\fpeval}
 %   The expandable command \cs{fpeval} takes as it's argument a floating
@@ -132,6 +133,20 @@
 %   = \fpeval{sin 3.5 /2 + 2e-3} $.
 % \end{verbatim}
 %
+% \begin{function}[EXP]{\inteval}
+%   The expandable command \cs{inteval} takes as it's argument an integer
+%   expression and will produce a result using the normal rules of
+%   mathematics. The operations recognised are |+|, |-|, |*| and |/| plus
+%   parentheses. Division occurs with \emph{roudning}. As this command i
+%   expandable it can be used where \TeX{} requires a number and for example
+%   within a low-level \cs{edef} operation to give a purely numerical result.
+% \end{function}
+%
+% An example of use could be the following.
+% \begin{verbatim}
+%   \LaTeX{} can now compute: The sum of the numbers is $\inteval{1 + 2 + 3}$.
+% \end{verbatim}
+%
 % \end{documentation}
 %
 % \begin{implementation}
@@ -154,6 +169,13 @@
 %    \end{macrocode}
 % \end{macro}
 %
+% \begin{macro}{\inteval}
+%   A second one, this time around an \eTeX{} primitive.
+%    \begin{macrocode}
+\NewExpandableDocumentCommand \inteval { m } { \int_eval:n {#1} }
+%    \end{macrocode}
+% \end{macro}
+%
 %    \begin{macrocode}
 %</package>
 %    \end{macrocode}

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the latex3-commits mailing list