I'm trying to calculate the factorial with the xfp
package.
In the documentation (http://ctan.cs.uu.nl/macros/latex/contrib/l3packages/xfp.pdf), I have found the function name to be fact
. My code looks as follows:
\documentclass{article}
\usepackage{xfp}
\begin{document}
\fpeval{fact(4)}
\end{document}
But, I get following error:
! Undefined control sequence.
<argument> \LaTeX3 error:
Unknown fp word fact.
l.4 \fpeval{fact(4)}
While other functions do work (e.g. no error for \fpeval{16*4^3}
or \fpeval{cosd(60)*45}
)
What am I doing wrong? I am using TeXstudio.
UPDATE
In the preamble I set \usepackage{xfp}[2019/08/25]
with the date I found in the documentation between square brackets.
I get the same error as before and following warning:
You have requested, on input line 3, version `2019/08/25' of package xfp,
but only version `2018-09-24 L3 Floating point unit' is available.
When I set \usepackage{xfp}[2018/09/24]
, I get same error (and no warning).
In any case (with or without date in square brackets), I see following lines in log-file:
Package: expl3 2018-09-24 L3 programming layer (code)
Package: xparse 2018-09-24 L3 Experimental document command parser
Package: xfp 2018-09-24 L3 Floating point unit
I'm using Texworks remotely via the company server, so I have no access to package manager or whatever. Also can not use texdoc. Is there a way to force package update from within Texworks? (probably not ...)
fact
function was added as recently as march this year it seems, so the version you have on your system probably doesn't correspond to the manual you read.texdoc <packagename>
. So withtexdoc xfp
you'll get the manual for the specific version ofxfp
you currently have.xintexpr
which does everything I need.