The question mark ?
is the “not ordered” comparison of l3fp
. More or less quoting from the documentation of \fp_compare_p:nNn
:
x ? y
is true if x
and y
are “not ordered” which occurs exactly if one or both operands is nan
or is a tuple. Note that nan
is distinct from any other value, even from itself, i.e. if x = nan
then x == x
is false. To test whether a value is nan
you can use the “not ordered” comparison with any other value, e.g. x ? 0
.
That also means that if neither x
nor y
are nan
or a tuple, the comparison x >? y
will be equivalent to x > y
.
Personal note: I'm rather skeptical of the usefulness of this “not ordered” comparison. It seems to me that this is trying to solve a problem that is already covered by other operators. For example in a traditional programming language, like C, you can check for nan
by checking whether a value is equal to itself, i.e. x == x
will only ever be false, if x
is nan
. For comparison between tuples, all operators should just return false
(or better throw a type error), except for ==
and !=
which ought to perform and element-wise comparison.
\fpeval
is just a wrapper of latex3 function\fp_eval:n
(documented ininterface3
) which accepts a floating point expression. 2) From the doc, sec. XXIII.9.3, a relation operator should consists of a non-empty string of<
,=
,>
, and?
, optionally preceded by!
, and may not start with?
. 3) Hence\x >? \y
means if\x
is greater than or not ordered with\y
.