I just discovered that we can now create new functions (fp words) that can be evaluated inside \fp_eval:n per page 273 of interface3.pdf (it also seems to work with \fpeval). This is straightforward as the demo shows.
What if I want, or need, to manipulate the function arguments to get the returned result? I can't get that to work. This functionality may not be provided yet, but I don't see it mentioned in the documentatin and searching this site turned up nothing (or I somehow missed it).
MWE:
% !TEX program = lualatexmk
% !TEX encoding = UTF-8 Unicode
\documentclass{article}
\ExplSyntaxOn
% This works.
\fp_new_function:n { npow }
\fp_set_function:nnn { npow } { a,b } { a**b }
% This does not work.
\fp_new_function:n { biggerof }
\fp_set_function:nnn { biggerof } { a,b }
{
\fp_compare:nTF { a < b }
{ b }
{ a }
}
\ExplSyntaxOff
\begin{document}
\( \alpha = \fpeval{npow(2,3)} \)
\( \alpha = \fpeval{biggerof(2,3)} \)
\end{document}
\fpeval{2 < 3 ? 3 : 2}but that probably is not what you were hoping for.