%%
%% This is file `xintexpr.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% xint.dtx  (with options: `xintexpr')
%% 
%% IMPORTANT NOTICE:
%% 
%% For the copyright see the source file.
%% 
%% Any modified versions of this file must be renamed
%% with new filenames distinct from xintexpr.sty.
%% 
%% For distribution of the original source see the terms
%% for copying and modification in the file xint.dtx.
%% 
%% This generated file may be distributed as long as the
%% original source files, as listed above, are part of the
%% same distribution. (The sources need not necessarily be
%% in the same archive or directory.)
%%
%%----------------------------------------------------------------
%% The xint bundle (version 1.09h of November 28, 2013)
%% xintexpr: Expandable expression parser
%% Copyright (C) 2013 by Jean-Francois Burnol
%%----------------------------------------------------------------
%%
\begingroup\catcode61\catcode48\catcode32=10\relax%
  \catcode13=5    % ^^M
  \endlinechar=13 %
  \catcode123=1   % {
  \catcode125=2   % }
  \catcode64=11   % @
  \catcode35=6    % #
  \catcode44=12   % ,
  \catcode45=12   % -
  \catcode46=12   % .
  \catcode58=12   % :
  \def\space { }%
  \let\z\endgroup
  \expandafter\let\expandafter\x\csname ver@xintexpr.sty\endcsname
  \expandafter\let\expandafter\w\csname ver@xintfrac.sty\endcsname
  \expandafter
    \ifx\csname PackageInfo\endcsname\relax
      \def\y#1#2{\immediate\write-1{Package #1 Info: #2.}}%
    \else
      \def\y#1#2{\PackageInfo{#1}{#2}}%
    \fi
  \expandafter
  \ifx\csname numexpr\endcsname\relax
     \y{xintexpr}{\numexpr not available, aborting input}%
     \aftergroup\endinput
  \else
    \ifx\x\relax   % plain-TeX, first loading of xintexpr.sty
      \ifx\w\relax % but xintfrac.sty not yet loaded.
         \y{xintexpr}{Package xintfrac is required}%
         \y{xintexpr}{Will try \string\input\space xintfrac.sty}%
         \def\z{\endgroup\input xintfrac.sty\relax}%
      \fi
    \else
      \def\empty {}%
      \ifx\x\empty % LaTeX, first loading,
      % variable is initialized, but \ProvidesPackage not yet seen
          \ifx\w\relax % xintfrac.sty not yet loaded.
            \y{xintexpr}{Package xintfrac is required}%
            \y{xintexpr}{Will try \string\RequirePackage{xintfrac}}%
            \def\z{\endgroup\RequirePackage{xintfrac}}%
          \fi
      \else
        \y{xintexpr}{I was already loaded, aborting input}%
        \aftergroup\endinput
      \fi
    \fi
  \fi
\z%
\begingroup\catcode61\catcode48\catcode32=10\relax%
  \catcode13=5    % ^^M
  \endlinechar=13 %
  \catcode123=1   % {
  \catcode125=2   % }
  \catcode64=11   % @
  \catcode35=6    % #
  \catcode44=12   % ,
  \catcode45=12   % -
  \catcode46=12   % .
  \catcode58=12   % :
  \ifdefined\PackageInfo
      \def\y#1#2{\PackageInfo{#1}{#2}}%
    \else
      \def\y#1#2{\immediate\write-1{Package #1 Info: #2.}}%
  \fi
  \def\empty {}%
  \expandafter\let\expandafter\w\csname ver@xintfrac.sty\endcsname
  \ifx\w\relax % Plain TeX, user gave a file name at the prompt
      \y{xintexpr}{Loading of package xintfrac failed, aborting input}%
      \aftergroup\endinput
  \fi
  \ifx\w\empty % LaTeX, user gave a file name at the prompt
      \y{xintexpr}{Loading of package xintfrac failed, aborting input}%
      \aftergroup\endinput
  \fi
\endgroup%
\XINTsetupcatcodes%
\XINT_providespackage
\ProvidesPackage{xintexpr}%
  [2013/11/28 v1.09h Expandable expression parser (jfB)]%
\def\xint_gob_til_dot #1.{}%
\def\xint_gob_til_dot_andstop #1.{ }%
\def\xint_gob_til_! #1!{}% nota bene: ! is of catcode 11
\def\XINT_expr_unexpectedtoken {\xintError:ignored }%
\def\XINT_newexpr_stripprefix #1>{\noexpand\romannumeral-`0}%
\def\XINT_expr_lock #1!{\expandafter\space\csname .#1\endcsname }%
\def\XINT_expr_unlock  {\expandafter\xint_gob_til_dot\string }%
\def\XINT_expr_usethe  {use_xintthe!\xintError:use_xintthe! }%
\def\XINT_expr_done    {!\XINT_expr_usethe\XINT_expr_print }%
\def\XINT_expr_print   #1{\XINT_expr_unlock #1}%
\def\XINT_flexpr_done    {!\XINT_expr_usethe\XINT_flexpr_print }%
\def\XINT_flexpr_print  #1{\xintFloat:csv{\XINT_expr_unlock #1}}%
\def\XINT_numexpr_print #1{\xintRound:csv{\XINT_expr_unlock #1}}%
\def\XINT_boolexpr_print #1{\xintIsTrue:csv{\XINT_expr_unlock #1}}%
\def\xintifboolexpr #1{\romannumeral0\xintifnotzero {\xinttheexpr #1\relax}}%
\def\xintifboolfloatexpr #1{\romannumeral0\xintifnotzero
                                {\xintthefloatexpr #1\relax}}%
\def\xintexpr    {\romannumeral0\xinteval }%
\def\xinteval
{%
    \expandafter\XINT_expr_until_end_a \romannumeral-`0\XINT_expr_getnext
}%
\def\xinttheeval {\expandafter\xint_gobble_ii\romannumeral0\xinteval }%
\def\xinttheexpr {\romannumeral-`0\xinttheeval }%
\def\XINT_numexpr_post !\XINT_expr_usethe\XINT_expr_print%
                     { !\XINT_expr_usethe\XINT_numexpr_print }%
\def\xintnumexpr {\romannumeral0\expandafter\XINT_numexpr_post
                  \romannumeral0\xinteval }%
\def\xintthenumexpr   {\romannumeral-`0\xintthe\xintnumexpr }%
\def\XINT_boolexpr_post !\XINT_expr_usethe\XINT_expr_print%
                     { !\XINT_expr_usethe\XINT_boolexpr_print }%
\def\xintboolexpr {\romannumeral0\expandafter\XINT_boolexpr_post
                  \romannumeral0\xinteval }%
\def\xinttheboolexpr  {\romannumeral-`0\xintthe\xintboolexpr }%
\def\xintfloatexpr    {\romannumeral0\xintfloateval }%
\def\xintfloateval
{%
    \expandafter\XINT_flexpr_until_end_a \romannumeral-`0\XINT_expr_getnext
}%
\def\xintthefloatexpr {\romannumeral-`0\xintthe\xintfloatexpr }%
\def\xintthe #1{\romannumeral-`0\expandafter\xint_gobble_ii\romannumeral-`0#1}%
\def\XINT_expr_getnext
{%
    \expandafter\XINT_expr_getnext_checkforbraced_a
    \romannumeral-`0\romannumeral-`0%
}%
\def\XINT_expr_getnext_checkforbraced_a #1%
{%
    \XINT_expr_getnext_checkforbraced_b #1\W\Z {#1}%
}%
\def\XINT_expr_getnext_checkforbraced_b #1#2%
{%
    \xint_UDwfork
       #1\dummy \XINT_expr_getnext_emptybracepair
       #2\dummy \XINT_expr_getnext_onetoken_perhaps
       \W\dummy \XINT_expr_getnext_gotbracedstuff
    \krof
}%
\def\XINT_expr_getnext_onetoken_perhaps\Z #1%
{%
    \expandafter\XINT_expr_getnext_checkforbraced_c\expandafter
    {\romannumeral-`0#1}%
}%
\def\XINT_expr_getnext_checkforbraced_c #1%
{%
    \XINT_expr_getnext_checkforbraced_d #1\W\Z {#1}%
}%
\def\XINT_expr_getnext_checkforbraced_d #1#2%
{%
    \xint_UDwfork
       #1\dummy \XINT_expr_getnext_emptybracepair
       #2\dummy \XINT_expr_getnext_onetoken_wehope
       \W\dummy \XINT_expr_getnext_gotbracedstuff
    \krof
}% doubly braced things are not acceptable, will cause errors.
\def\XINT_expr_getnext_emptybracepair #1{\XINT_expr_getnext }%
\def\XINT_expr_getnext_gotbracedstuff #1\W\Z #2% {..} -> number/fraction
{%
    \expandafter\XINT_expr_getop\csname .#2\endcsname
}%
\def\XINT_expr_getnext_onetoken_wehope\Z #1% #1 isn't a control sequence!
{%
    \xint_gob_til_! #1\XINT_expr_subexpr !%
    \expandafter\XINT_expr_getnext_onetoken_fork\string #1%
}% after this #1 should be now a catcode 12 token.
\def\XINT_expr_subexpr !#1!{\expandafter\XINT_expr_getop\xint_gobble_ii }%
\begingroup
\lccode`*=`#
\lowercase{\endgroup
\def\XINT_expr_sixwayfork #1(-.+*\dummy #2#3\krof {#2}%
\def\XINT_expr_getnext_onetoken_fork #1%
{% The * is in truth catcode 12 #. For (clever!) use with \xintNewExpr.
    \XINT_expr_sixwayfork
        #1-.+*\dummy  {\xint_c_xviii ({}}% back to until to trigger oparen
        (#1.+*\dummy   -%
        (-#1+*\dummy  {\XINT_expr_scandec_II.}%
        (-.#1*\dummy   \XINT_expr_getnext%
         (-.+#1\dummy {\XINT_expr_scandec_II}%
         (-.+*\dummy  {\XINT_expr_scan_dec_or_func #1}%
    \krof
}}%
\def\XINT_expr_scan_dec_or_func #1% this #1 of catcode 12
{%
    \ifnum \xint_c_ix<1#1
        \expandafter\XINT_expr_scandec_I
    \else % We assume we are dealing with a function name!!
        \expandafter\XINT_expr_scanfunc
    \fi #1%
}%
\def\XINT_expr_scanfunc
{%
    \expandafter\XINT_expr_func\romannumeral-`0\XINT_expr_scanfunc_c
}%
\def\XINT_expr_scanfunc_c #1%
{%
    \expandafter #1\romannumeral-`0\expandafter
    \XINT_expr_scanfunc_a\romannumeral-`0\romannumeral-`0%
}%
\def\XINT_expr_scanfunc_a #1% please no braced things here!
{%
    \ifcat #1\relax % missing opening parenthesis, probably
        \expandafter\XINT_expr_scanfunc_panic
    \else
        \xint_afterfi{\expandafter\XINT_expr_scanfunc_b \string #1}%
    \fi
}%
\def\XINT_expr_scanfunc_b #1%
{%
    \if #1(\expandafter \xint_gobble_iii\fi
    \xint_firstofone
    {% added in 1.09c for bool and togl
     \if #1)\expandafter \xint_gobble_i
      \else \expandafter \xint_firstoftwo
     \fi }%
    {\XINT_expr_scanfunc_c #1}(%
}%
\def\XINT_expr_scanfunc_panic {\xintError:bigtroubleahead(0\relax }%
\def\XINT_expr_func #1(% common to expr and flexpr
{%
    \xint_c_xviii @{#1}% functions have the highest priority.
}%
\def\XINT_expr_scandec_I
{%
    \expandafter\XINT_expr_getop\romannumeral-`0\expandafter
    \XINT_expr_lock\romannumeral-`0\XINT_expr_scanintpart_b
}%
\def\XINT_expr_scandec_II
{%
    \expandafter\XINT_expr_getop\romannumeral-`0\expandafter
    \XINT_expr_lock\romannumeral-`0\XINT_expr_scanfracpart_b
}%
\def\XINT_expr_scanintpart_a #1%
{%
    \ifnum \xint_c_ix<1\string#1
       \expandafter\expandafter\expandafter\XINT_expr_scanintpart_b
       \expandafter\string
    \else
       \if #1.%
           \expandafter\expandafter\expandafter
           \XINT_expr_scandec_transition
       \else
           \expandafter\expandafter\expandafter !% ! of catcode 11...
       \fi
    \fi
    #1%
}%
\def\XINT_expr_scanintpart_b #1%
{%
    \expandafter #1\romannumeral-`0\expandafter
    \XINT_expr_scanintpart_a\romannumeral-`0\romannumeral-`0%
}%
\def\XINT_expr_scandec_transition #1%
{%
    \expandafter.\romannumeral-`0\expandafter
    \XINT_expr_scanfracpart_a\romannumeral-`0\romannumeral-`0%
}%
\def\XINT_expr_scanfracpart_a #1%
{%
    \ifnum \xint_c_ix<1\string#1
       \expandafter\expandafter\expandafter\XINT_expr_scanfracpart_b
       \expandafter\string
    \else
       \expandafter !%
    \fi
    #1%
}%
\def\XINT_expr_scanfracpart_b #1%
{%
    \expandafter #1\romannumeral-`0\expandafter
    \XINT_expr_scanfracpart_a\romannumeral-`0\romannumeral-`0%
}%
\def\XINT_expr_getop #1% this #1 is the current locked computed value
{%  full expansion of next token, first swallowing a possible space
    \expandafter\XINT_expr_getop_a\expandafter #1%
    \romannumeral-`0\romannumeral-`0%
}%
\def\XINT_expr_getop_a #1#2%
{%  if an un-expandable control sequence is found, must be the ending \relax
    \ifcat #2\relax
        \ifx #2\relax
             \expandafter\expandafter\expandafter
             \XINT_expr_foundend
        \else
             \XINT_expr_unexpectedtoken
             \expandafter\expandafter\expandafter
             \XINT_expr_getop
        \fi
    \else
        \expandafter\XINT_expr_foundop\expandafter #2%
    \fi
    #1%
}%
\def\XINT_expr_foundend {\xint_c_ \relax }% \relax is a place holder here.
\def\XINT_expr_foundop #1% then becomes <prec> <op> and is followed by <\.f>
{%  1.09a: no control sequence \XINT_expr_op_#1, code common to expr/flexpr
    \ifcsname XINT_expr_precedence_#1\endcsname
        \expandafter\xint_afterfi\expandafter
        {\csname XINT_expr_precedence_#1\endcsname #1}%
    \else
        \XINT_expr_unexpectedtoken
        \expandafter\XINT_expr_getop
    \fi
}%
\def\XINT_tmpa #1#2#3#4#5%
{%
    \def#1##1%
    {%
        \xint_UDsignfork
                     ##1\dummy {\expandafter#1\romannumeral-`0#3}%
                       -\dummy  {#2##1}%
        \krof
    }%
    \def#2##1##2%
    {%
        \ifcase ##1\expandafter #4%
        \or   \xint_afterfi{%
                \XINT_expr_extra_closing_paren
                \expandafter #1\romannumeral-`0\XINT_expr_getop
                 }%
        \else \xint_afterfi{%
                \expandafter#1\romannumeral-`0\csname XINT_#5_op_##2\endcsname
                 }%
        \fi
    }%
}%
\expandafter\XINT_tmpa
    \csname XINT_expr_until_end_a\expandafter\endcsname
    \csname XINT_expr_until_end_b\expandafter\endcsname
    \csname XINT_expr_op_-vi\expandafter\endcsname
    \csname XINT_expr_done\endcsname
    {expr}%
\expandafter\XINT_tmpa
    \csname XINT_flexpr_until_end_a\expandafter\endcsname
    \csname XINT_flexpr_until_end_b\expandafter\endcsname
    \csname XINT_flexpr_op_-vi\expandafter\endcsname
    \csname XINT_flexpr_done\endcsname
    {flexpr}%
\def\XINT_expr_extra_closing_paren {\xintError:removed }%
\def\XINT_tmpa #1#2#3#4#5#6%
{%
    \def #1{\expandafter #3\romannumeral-`0\XINT_expr_getnext }%
    \let #2#1%
    \def #3##1{\xint_UDsignfork
                ##1\dummy {\expandafter #3\romannumeral-`0#5}%
                  -\dummy  {#4##1}%
               \krof }%
    \def #4##1##2%
    {%
        \ifcase ##1\expandafter \XINT_expr_missing_cparen
             \or   \expandafter \XINT_expr_getop
             \else \xint_afterfi
        {\expandafter #3\romannumeral-`0\csname XINT_#6_op_##2\endcsname }%
        \fi
    }%
}%
\expandafter\XINT_tmpa
    \csname XINT_expr_op_(\expandafter\endcsname
    \csname XINT_expr_oparen\expandafter\endcsname
    \csname XINT_expr_until_)_a\expandafter\endcsname
    \csname XINT_expr_until_)_b\expandafter\endcsname
    \csname XINT_expr_op_-vi\endcsname
    {expr}%
\expandafter\XINT_tmpa
    \csname XINT_flexpr_op_(\expandafter\endcsname
    \csname XINT_flexpr_oparen\expandafter\endcsname
    \csname XINT_flexpr_until_)_a\expandafter\endcsname
    \csname XINT_flexpr_until_)_b\expandafter\endcsname
    \csname XINT_flexpr_op_-vi\endcsname
    {flexpr}%
\def\XINT_expr_missing_cparen {\xintError:inserted \xint_c_ \XINT_expr_done }%
\expandafter\let\csname XINT_expr_precedence_)\endcsname \xint_c_i
\expandafter\let\csname XINT_expr_op_)\endcsname\XINT_expr_getop
\expandafter\let\csname XINT_flexpr_precedence_)\endcsname \xint_c_i
\expandafter\let\csname XINT_flexpr_op_)\endcsname\XINT_expr_getop
\def\XINT_tmpb #1#2#3#4#5#6%
{%
    \expandafter\XINT_tmpc
    \csname XINT_#1_op_#3\expandafter\endcsname
    \csname XINT_#1_until_#3_a\expandafter\endcsname
    \csname XINT_#1_until_#3_b\expandafter\endcsname
    \csname XINT_#1_op_-#5\expandafter\endcsname
    \csname xint_c_#4\expandafter\endcsname
    \csname #2#6\expandafter\endcsname
    \csname XINT_expr_precedence_#3\endcsname {#1}%
}%
\def\XINT_tmpc #1#2#3#4#5#6#7#8%
{%
    \def #1##1% \XINT_expr_op_<op>
    {% keep value, get next number and operator, then do until
        \expandafter #2\expandafter ##1%
        \romannumeral-`0\expandafter\XINT_expr_getnext
    }%
    \def #2##1##2% \XINT_expr_until_<op>_a
    {\xint_UDsignfork
        ##2\dummy {\expandafter #2\expandafter ##1\romannumeral-`0#4}%
          -\dummy {#3##1##2}%
     \krof }%
    \def #3##1##2##3##4% \XINT_expr_until_<op>_b
    {%  either execute next operation now, or first do next (possibly unary)
      \ifnum ##2>#5%
        \xint_afterfi {\expandafter #2\expandafter ##1\romannumeral-`0%
                       \csname XINT_#8_op_##3\endcsname {##4}}%
      \else
        \xint_afterfi
        {\expandafter ##2\expandafter ##3%
         \csname .#6{\XINT_expr_unlock ##1}{\XINT_expr_unlock ##4}\endcsname }%
      \fi
    }%
    \let #7#5%
}%
\def\XINT_tmpa #1{\XINT_tmpb {expr}{xint}#1}%
\xintApplyInline {\XINT_tmpa }{%
  {|{iii}{vi}{OR}}%
  {&{iv}{vi}{AND}}%
  {<{v}{vi}{Lt}}%
  {>{v}{vi}{Gt}}%
  {={v}{vi}{Eq}}%
  {+{vi}{vi}{Add}}%
  {-{vi}{vi}{Sub}}%
  {*{vii}{vii}{Mul}}%
  {/{vii}{vii}{Div}}%
  {^{viii}{viii}{Pow}}%
  {e{ix}{ix}{fE}}%
  {E{ix}{ix}{fE}}%
}%
\def\XINT_tmpa #1{\XINT_tmpb {flexpr}{xint}#1}%
\xintApplyInline {\XINT_tmpa }{%
  {|{iii}{vi}{OR}}%
  {&{iv}{vi}{AND}}%
  {<{v}{vi}{Lt}}%
  {>{v}{vi}{Gt}}%
  {={v}{vi}{Eq}}%
}%
\def\XINT_tmpa #1{\XINT_tmpb {flexpr}{XINTinFloat}#1}%
\xintApplyInline {\XINT_tmpa }{%
  {+{vi}{vi}{Add}}%
  {-{vi}{vi}{Sub}}%
  {*{vii}{vii}{Mul}}%
  {/{vii}{vii}{Div}}%
  {^{viii}{viii}{Power}}%
  {e{ix}{ix}{fE}}%
  {E{ix}{ix}{fE}}%
}%
\def\XINT_tmpa #1#2#3#4#5#6%
{%
    \def #1##1% \XINT_expr_op_,_a
    {%
        \expandafter #2\expandafter ##1\romannumeral-`0\XINT_expr_getnext
    }%
    \def #2##1##2% \XINT_expr_until_,_a
    {\xint_UDsignfork
        ##2\dummy {\expandafter #2\expandafter ##1\romannumeral-`0#4}%
          -\dummy {#3##1##2}%
     \krof }%
    \def #3##1##2##3##4% \XINT_expr_until_,_b
    {%
      \ifnum ##2>\xint_c_ii
        \xint_afterfi {\expandafter #2\expandafter ##1\romannumeral-`0%
                       \csname XINT_#6_op_##3\endcsname {##4}}%
      \else
        \xint_afterfi
        {\expandafter ##2\expandafter ##3%
         \csname .\XINT_expr_unlock ##1,\XINT_expr_unlock ##4\endcsname }%
      \fi
    }%
    \let #5\xint_c_ii
}%
\expandafter\XINT_tmpa
    \csname XINT_expr_op_,\expandafter\endcsname
    \csname XINT_expr_until_,_a\expandafter\endcsname
    \csname XINT_expr_until_,_b\expandafter\endcsname
    \csname XINT_expr_op_-vi\expandafter\endcsname
    \csname XINT_expr_precedence_,\endcsname {expr}%
\expandafter\XINT_tmpa
    \csname XINT_flexpr_op_,\expandafter\endcsname
    \csname XINT_flexpr_until_,_a\expandafter\endcsname
    \csname XINT_flexpr_until_,_b\expandafter\endcsname
    \csname XINT_flexpr_op_-vi\expandafter\endcsname
    \csname XINT_expr_precedence_,\endcsname {flexpr}%
\def\XINT_tmpa #1#2%
{%
    \expandafter\XINT_tmpb
    \csname XINT_#1_op_-#2\expandafter\endcsname
    \csname XINT_#1_until_-#2_a\expandafter\endcsname
    \csname XINT_#1_until_-#2_b\expandafter\endcsname
    \csname xint_c_#2\endcsname {#1}%
}%
\def\XINT_tmpb #1#2#3#4#5%
{%
    \def #1% \XINT_expr_op_-<level>
    {%  get next number+operator then switch to _until macro
        \expandafter #2\romannumeral-`0\XINT_expr_getnext
    }%
    \def #2##1% \XINT_expr_until_-<l>_a
    {\xint_UDsignfork
        ##1\dummy {\expandafter #2\romannumeral-`0#1}%
          -\dummy {#3##1}%
     \krof }%
    \def #3##1##2##3% \XINT_expr_until_-<l>_b
    {%  _until tests precedence level with next op, executes now or postpones
        \ifnum ##1>#4%
         \xint_afterfi {\expandafter #2\romannumeral-`0%
                        \csname XINT_#5_op_##2\endcsname {##3}}%
        \else
         \xint_afterfi {\expandafter ##1\expandafter ##2%
                        \csname .\xintOpp{\XINT_expr_unlock ##3}\endcsname }%
        \fi
    }%
}%
\xintApplyInline{\XINT_tmpa {expr}}{{vi}{vii}{viii}{ix}}%
\xintApplyInline{\XINT_tmpa {flexpr}}{{vi}{vii}{viii}{ix}}%
\let\XINT_expr_precedence_? \xint_c_x
\def \XINT_expr_op_? #1#2#3%
{%
        \xintifZero{\XINT_expr_unlock  #1}%
                   {\XINT_expr_getnext #3}%
                   {\XINT_expr_getnext #2}%
}%
\let\XINT_flexpr_op_?\XINT_expr_op_?
\let\XINT_expr_precedence_: \xint_c_x
\def \XINT_expr_op_: #1#2#3#4%
{%
        \xintifSgn {\XINT_expr_unlock  #1}%
                   {\XINT_expr_getnext #2}%
                   {\XINT_expr_getnext #3}%
                   {\XINT_expr_getnext #4}%
}%
\let\XINT_flexpr_op_:\XINT_expr_op_:
\let\XINT_expr_precedence_! \xint_c_x
\def\XINT_expr_op_! #1{\expandafter\XINT_expr_getop
       \csname .\xintFac{\XINT_expr_unlock #1}\endcsname }% [0] removed in 1.09c
\let\XINT_flexpr_op_!\XINT_expr_op_!
\def\XINT_expr_op_@ #1%
{%
    \ifcsname XINT_expr_onlitteral_#1\endcsname
       \expandafter\XINT_expr_funcoflitteral
    \else
       \expandafter\XINT_expr_op_@@
    \fi {#1}%
}%
\def\XINT_flexpr_op_@ #1%
{%
    \ifcsname XINT_expr_onlitteral_#1\endcsname
       \expandafter\XINT_expr_funcoflitteral
    \else
       \expandafter\XINT_flexpr_op_@@
    \fi {#1}%
}%
\def\XINT_expr_funcoflitteral #1%
{%
    \expandafter\expandafter\csname XINT_expr_onlitteral_#1\endcsname
    \romannumeral-`0\XINT_expr_scanfunc
}%
\def\XINT_expr_op_@@ #1%
{%
    \ifcsname XINT_expr_func_#1\endcsname
    \xint_afterfi{\expandafter\expandafter\csname XINT_expr_func_#1\endcsname}%
    \else \xintError:unknownfunction
          \xint_afterfi{\expandafter\XINT_expr_func_unknown}%
    \fi
    \romannumeral-`0\XINT_expr_oparen
}%
\def\XINT_flexpr_op_@@ #1%
{%
    \ifcsname XINT_flexpr_func_#1\endcsname
    \xint_afterfi{\expandafter\expandafter\csname XINT_flexpr_func_#1\endcsname}%
    \else \xintError:unknownfunction
          \xint_afterfi{\expandafter\XINT_expr_func_unknown}%
    \fi
    \romannumeral-`0\XINT_flexpr_oparen
}%
\def\XINT_expr_onlitteral_bool #1#2#3{\expandafter\XINT_expr_getop
    \csname .\xintBool{#3}\endcsname }%
\def\XINT_expr_onlitteral_togl #1#2#3{\expandafter\XINT_expr_getop
    \csname .\xintToggle{#3}\endcsname }%
\def\XINT_expr_func_unknown #1#2#3%
{%
    \expandafter #1\expandafter #2\csname .0[0]\endcsname
}%
\def\XINT_expr_func_reduce #1#2#3%
{%
    \expandafter #1\expandafter #2\csname
         .\xintIrr {\XINT_expr_unlock #3}\endcsname
}%
\let\XINT_flexpr_func_reduce\XINT_expr_func_reduce
\def\XINT_expr_func_sqr #1#2#3%
{%
    \expandafter #1\expandafter #2\csname
         .\xintSqr {\XINT_expr_unlock #3}\endcsname
}%
\def\XINT_flexpr_func_sqr #1#2#3%
{%
    \expandafter #1\expandafter #2\csname
    .\XINTinFloatMul {\XINT_expr_unlock #3}{\XINT_expr_unlock #3}\endcsname
}%
\def\XINT_expr_func_abs #1#2#3%
{%
    \expandafter #1\expandafter #2\csname
         .\xintAbs {\XINT_expr_unlock #3}\endcsname
}%
\let\XINT_flexpr_func_abs\XINT_expr_func_abs
\def\XINT_expr_func_sgn #1#2#3%
{%
    \expandafter #1\expandafter #2\csname
         .\xintSgn {\XINT_expr_unlock #3}\endcsname
}%
\let\XINT_flexpr_func_sgn\XINT_expr_func_sgn
\def\XINT_expr_func_floor #1#2#3%
{%
    \expandafter #1\expandafter #2\csname
         .\xintFloor {\XINT_expr_unlock #3}\endcsname
}%
\let\XINT_flexpr_func_floor\XINT_expr_func_floor
\def\XINT_expr_func_ceil #1#2#3%
{%
    \expandafter #1\expandafter #2\csname
         .\xintCeil {\XINT_expr_unlock #3}\endcsname
}%
\let\XINT_flexpr_func_ceil\XINT_expr_func_ceil
\def\XINT_expr_twoargs #1,#2,{{#1}{#2}}%
\def\XINT_expr_func_quo #1#2#3%
{%
    \expandafter #1\expandafter #2\csname .%
    \expandafter\expandafter\expandafter\xintQuo
    \expandafter\XINT_expr_twoargs
    \romannumeral-`0\XINT_expr_unlock #3,\endcsname
}%
\let\XINT_flexpr_func_quo\XINT_expr_func_quo
\def\XINT_expr_func_rem #1#2#3%
{%
    \expandafter #1\expandafter #2\csname .%
    \expandafter\expandafter\expandafter\xintRem
    \expandafter\XINT_expr_twoargs
    \romannumeral-`0\XINT_expr_unlock #3,\endcsname
}%
\let\XINT_flexpr_func_rem\XINT_expr_func_rem
\def\XINT_expr_oneortwo #1#2#3,#4,#5.%
{%
    \if\relax#5\relax\expandafter\xint_firstoftwo\else
                     \expandafter\xint_secondoftwo\fi
    {#1{0}{#3}}{#2{\xintNum {#4}}{#3}}%
}%
\def\XINT_expr_func_round #1#2#3%
{%
    \expandafter #1\expandafter #2\csname .%
    \expandafter\XINT_expr_oneortwo
    \expandafter\xintiRound\expandafter\xintRound
    \romannumeral-`0\XINT_expr_unlock #3,,.\endcsname
}%
\let\XINT_flexpr_func_round\XINT_expr_func_round
\def\XINT_expr_func_trunc #1#2#3%
{%
    \expandafter #1\expandafter #2\csname .%
    \expandafter\XINT_expr_oneortwo
    \expandafter\xintiTrunc\expandafter\xintTrunc
    \romannumeral-`0\XINT_expr_unlock #3,,.\endcsname
}%
\let\XINT_flexpr_func_trunc\XINT_expr_func_trunc
\def\XINT_expr_argandopt #1,#2,#3.%
{%
    \if\relax#3\relax\expandafter\xint_firstoftwo\else
                     \expandafter\xint_secondoftwo\fi
    {[\XINTdigits]{#1}}{[\xintNum {#2}]{#1}}%
}%
\def\XINT_expr_func_float #1#2#3%
{%
    \expandafter #1\expandafter #2\csname .%
    \expandafter\XINTinFloat
    \romannumeral-`0\expandafter\XINT_expr_argandopt
    \romannumeral-`0\XINT_expr_unlock #3,,.\endcsname
}%
\let\XINT_flexpr_func_float\XINT_expr_func_float
\def\XINT_expr_func_sqrt #1#2#3%
{%
    \expandafter #1\expandafter #2\csname .%
    \expandafter\XINTinFloatSqrt
    \romannumeral-`0\expandafter\XINT_expr_argandopt
    \romannumeral-`0\XINT_expr_unlock #3,,.\endcsname
}%
\let\XINT_flexpr_func_sqrt\XINT_expr_func_sqrt
\def\XINT_expr_func_gcd #1#2#3%
{%
    \expandafter #1\expandafter #2\csname
              .\xintGCDof:csv{\XINT_expr_unlock #3}\endcsname
}%
\let\XINT_flexpr_func_gcd\XINT_expr_func_gcd
\def\XINT_expr_func_lcm #1#2#3%
{%
    \expandafter #1\expandafter #2\csname
              .\xintLCMof:csv{\XINT_expr_unlock #3}\endcsname
}%
\let\XINT_flexpr_func_lcm\XINT_expr_func_lcm
\def\XINT_expr_func_max #1#2#3%
{%
    \expandafter #1\expandafter #2\csname
              .\xintMaxof:csv{\XINT_expr_unlock #3}\endcsname
}%
\def\XINT_flexpr_func_max #1#2#3%
{%
    \expandafter #1\expandafter #2\csname
              .\XINTinFloatMaxof:csv{\XINT_expr_unlock #3}\endcsname
}%
\def\XINT_expr_func_min #1#2#3%
{%
    \expandafter #1\expandafter #2\csname
              .\xintMinof:csv{\XINT_expr_unlock #3}\endcsname
}%
\def\XINT_flexpr_func_min #1#2#3%
{%
    \expandafter #1\expandafter #2\csname
              .\XINTinFloatMinof:csv{\XINT_expr_unlock #3}\endcsname
}%
\def\XINT_expr_func_sum #1#2#3%
{%
    \expandafter #1\expandafter #2\csname
              .\xintSum:csv{\XINT_expr_unlock #3}\endcsname
}%
\def\XINT_flexpr_func_sum #1#2#3%
{%
    \expandafter #1\expandafter #2\csname
              .\XINTinFloatSum:csv{\XINT_expr_unlock #3}\endcsname
}%
\def\XINT_expr_func_prd #1#2#3%
{%
    \expandafter #1\expandafter #2\csname
              .\xintPrd:csv{\XINT_expr_unlock #3}\endcsname
}%
\def\XINT_flexpr_func_prd #1#2#3%
{%
    \expandafter #1\expandafter #2\csname
              .\XINTinFloatPrd:csv{\XINT_expr_unlock #3}\endcsname
}%
\let\XINT_expr_func_add\XINT_expr_func_sum
\let\XINT_expr_func_mul\XINT_expr_func_prd
\let\XINT_flexpr_func_add\XINT_flexpr_func_sum
\let\XINT_flexpr_func_mul\XINT_flexpr_func_prd
\def\XINT_expr_func_? #1#2#3%
{%
    \expandafter #1\expandafter #2\csname
         .\xintIsNotZero {\XINT_expr_unlock #3}\endcsname
}%
\let\XINT_flexpr_func_? \XINT_expr_func_?
\def\XINT_expr_func_! #1#2#3%
{%
    \expandafter #1\expandafter #2\csname
         .\xintIsZero {\XINT_expr_unlock #3}\endcsname
}%
\let\XINT_flexpr_func_! \XINT_expr_func_!
\def\XINT_expr_func_not #1#2#3%
{%
    \expandafter #1\expandafter #2\csname
         .\xintIsZero {\XINT_expr_unlock #3}\endcsname
}%
\let\XINT_flexpr_func_not \XINT_expr_func_not
\def\XINT_expr_func_all #1#2#3%
{%
    \expandafter #1\expandafter #2\csname
              .\xintANDof:csv{\XINT_expr_unlock #3}\endcsname
}%
\let\XINT_flexpr_func_all\XINT_expr_func_all
\def\XINT_expr_func_any #1#2#3%
{%
    \expandafter #1\expandafter #2\csname
              .\xintORof:csv{\XINT_expr_unlock #3}\endcsname
}%
\let\XINT_flexpr_func_any\XINT_expr_func_any
\def\XINT_expr_func_xor #1#2#3%
{%
    \expandafter #1\expandafter #2\csname
              .\xintXORof:csv{\XINT_expr_unlock #3}\endcsname
}%
\let\XINT_flexpr_func_xor\XINT_expr_func_xor
\def\xintifNotZero:: #1,#2,#3,{\xintifNotZero{#1}{#2}{#3}}%
\def\XINT_expr_func_if #1#2#3%
{%
    \expandafter #1\expandafter #2\csname
              .\expandafter\xintifNotZero::
               \romannumeral-`0\XINT_expr_unlock #3,\endcsname
}%
\let\XINT_flexpr_func_if\XINT_expr_func_if
\def\xintifSgn:: #1,#2,#3,#4,{\xintifSgn{#1}{#2}{#3}{#4}}%
\def\XINT_expr_func_ifsgn #1#2#3%
{%
    \expandafter #1\expandafter #2\csname
              .\expandafter\xintifSgn::
               \romannumeral-`0\XINT_expr_unlock #3,\endcsname
}%
\let\XINT_flexpr_func_ifsgn\XINT_expr_func_ifsgn
\def\XINT_newexpr_print #1{\ifnum\xintNthElt{0}{#1}>1
                            \expandafter\xint_firstoftwo
                           \else
                            \expandafter\xint_secondoftwo
                           \fi
                           {_xintListWithSep,{#1}}{\xint_firstofone#1}}%
\xintForpair #1#2 in {(fl,Float),(num,iRound0),(bool,IsTrue)}\do {%
    \expandafter\def\csname XINT_new#1expr_print\endcsname
                      ##1{\ifnum\xintNthElt{0}{##1}>1
                            \expandafter\xint_firstoftwo
                           \else
                            \expandafter\xint_secondoftwo
                           \fi
                           {_xintListWithSep,{\xintApply{_xint#2}{##1}}}
                           {_xint#2##1}}}%
\toks0 {}%
\xintFor #1 in {Bool,Toggle,Floor,Ceil,iRound,Round,iTrunc,Trunc,%
        Lt,Gt,Eq,AND,OR,IsNotZero,IsZero,ifNotZero,ifSgn,%
        Irr,Num,Abs,Sgn,Opp,Quo,Rem,Add,Sub,Mul,Sqr,Div,Pow,Fac,fE}\do
 {\toks0
  \expandafter{\the\toks0\expandafter\def\csname xint#1\endcsname {_xint#1}}}%
\xintFor #1 in {GCDof,LCMof,Maxof,Minof,ANDof,ORof,XORof,Sum,Prd}\do
 {\toks0
  \expandafter{\the\toks0\expandafter\def\csname xint#1:csv\endcsname
                ####1{_xint#1{\xintCSVtoListNonStripped {####1}}}}}%
\xintFor #1 in {Maxof,Minof,Sum,Prd}\do
 {\toks0
  \expandafter{\the\toks0\expandafter\def\csname XINTinFloat#1:csv\endcsname
                ####1{_XINTinFloat#1{\xintCSVtoListNonStripped {####1}}}}}%
\xintFor #1 in {,Sqrt,Add,Sub,Mul,Div,Power,fE}\do
  {\toks0
   \expandafter{\the\toks0\expandafter\def\csname XINTinFloat#1\endcsname
              {_XINTinFloat#1}}}%
\expandafter\def\expandafter\XINT_expr_protect\expandafter{\the\toks0
    \def\XINTdigits {_XINTdigits}%
    \def\XINT_expr_print ##1{\expandafter\XINT_newexpr_print\expandafter
            {\romannumeral0\xintcsvtolistnonstripped{\XINT_expr_unlock ##1}}}%
    \def\XINT_flexpr_print ##1{\expandafter\XINT_newflexpr_print\expandafter
            {\romannumeral0\xintcsvtolistnonstripped{\XINT_expr_unlock ##1}}}%
    \def\XINT_numexpr_print ##1{\expandafter\XINT_newnumexpr_print\expandafter
            {\romannumeral0\xintcsvtolistnonstripped{\XINT_expr_unlock ##1}}}%
    \def\XINT_boolexpr_print ##1{\expandafter\XINT_newboolexpr_print\expandafter
            {\romannumeral0\xintcsvtolistnonstripped{\XINT_expr_unlock ##1}}}%
}%
\toks0 {}%
\def\xintNewExpr      {\xint_NewExpr\xinttheexpr      }%
\def\xintNewFloatExpr {\xint_NewExpr\xintthefloatexpr }%
\def\xintNewNumExpr   {\xint_NewExpr\xintthenumexpr   }%
\def\xintNewBoolExpr  {\xint_NewExpr\xinttheboolexpr  }%
\def\xint_NewExpr #1#2[#3]%
{%
 \begingroup
    \ifcase #3\relax
        \toks0 {\xdef #2}%
    \or \toks0 {\xdef #2##1}%
    \or \toks0 {\xdef #2##1##2}%
    \or \toks0 {\xdef #2##1##2##3}%
    \or \toks0 {\xdef #2##1##2##3##4}%
    \or \toks0 {\xdef #2##1##2##3##4##5}%
    \or \toks0 {\xdef #2##1##2##3##4##5##6}%
    \or \toks0 {\xdef #2##1##2##3##4##5##6##7}%
    \or \toks0 {\xdef #2##1##2##3##4##5##6##7##8}%
    \or \toks0 {\xdef #2##1##2##3##4##5##6##7##8##9}%
    \fi
    \xintexprSafeCatcodes
    \XINT_NewExpr #1%
}%
\catcode`* 13
\def\XINT_NewExpr #1#2%
{%
    \def\xintTmp ##1##2##3##4##5##6##7##8##9{#2}%
    \XINT_expr_protect
    \lccode`\*=`_ \lowercase {\def*}{!noexpand!}%
    \catcode`_ 13 \catcode`: 11 \endlinechar -1
    \everyeof {\noexpand }%
    \edef\XINTtmp ##1##2##3##4##5##6##7##8##9%
        {\scantokens
         \expandafter{\romannumeral-`0#1%
                      \xintTmp {####1}{####2}{####3}%
                               {####4}{####5}{####6}%
                               {####7}{####8}{####9}%
                      \relax}}%
     \lccode`\*=`\$ \lowercase {\def*}{####}%
     \catcode`\$ 13 \catcode`! 0 \catcode`_ 11 %
     \the\toks0
     {\scantokens\expandafter{\expandafter
                 \XINT_newexpr_stripprefix\meaning\XINTtmp}}%
  \endgroup
}%
\let\xintexprRestoreCatcodes\relax
\def\xintexprSafeCatcodes
{% for end user.
    \edef\xintexprRestoreCatcodes  {%
        \catcode63=\the\catcode63   % ?
        \catcode124=\the\catcode124 % |
        \catcode38=\the\catcode38   % &
        \catcode33=\the\catcode33   % !
        \catcode93=\the\catcode93   % ]
        \catcode91=\the\catcode91   % [
        \catcode94=\the\catcode94   % ^
        \catcode95=\the\catcode95   % _
        \catcode47=\the\catcode47   % /
        \catcode41=\the\catcode41   % )
        \catcode40=\the\catcode40   % (
        \catcode42=\the\catcode42   % *
        \catcode43=\the\catcode43   % +
        \catcode62=\the\catcode62   % >
        \catcode60=\the\catcode60   % <
        \catcode58=\the\catcode58   % :
        \catcode46=\the\catcode46   % .
        \catcode45=\the\catcode45   % -
        \catcode44=\the\catcode44   % ,
        \catcode61=\the\catcode61\relax   % =
    }% this is just for some standard situation with a few made active by Babel
        \catcode63=12  % ?
        \catcode124=12 % |
        \catcode38=4   % &
        \catcode33=12  % !
        \catcode93=12  % ]
        \catcode91=12  % [
        \catcode94=7   % ^
        \catcode95=8   % _
        \catcode47=12  % /
        \catcode41=12  % )
        \catcode40=12  % (
        \catcode42=12  % *
        \catcode43=12  % +
        \catcode62=12  % >
        \catcode60=12  % <
        \catcode58=12  % :
        \catcode46=12  % .
        \catcode45=12  % -
        \catcode44=12  % ,
        \catcode61=12  % =
}%
\let\XINT_tmpa\relax \let\XINT_tmpb\relax \let\XINT_tmpc\relax
\XINT_restorecatcodes_endinput%
\endinput
%%
%% End of file `xintexpr.sty'.
