summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/xint/xintcore.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2017-08-30 23:00:58 +0000
committerKarl Berry <karl@freefriends.org>2017-08-30 23:00:58 +0000
commit96aac111c7824c49a05e48fdbb2a1eba6313d062 (patch)
tree4294864efc6bba2c700ba4c6d537132b89aa596d /Master/texmf-dist/tex/generic/xint/xintcore.sty
parentf3fd3b4467cd76a039a199abe6944cfb00fea1e0 (diff)
xint (30aug17)
git-svn-id: svn://tug.org/texlive/trunk@45177 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic/xint/xintcore.sty')
-rw-r--r--Master/texmf-dist/tex/generic/xint/xintcore.sty150
1 files changed, 90 insertions, 60 deletions
diff --git a/Master/texmf-dist/tex/generic/xint/xintcore.sty b/Master/texmf-dist/tex/generic/xint/xintcore.sty
index 579e8de0ff0..b1f73e6a6c6 100644
--- a/Master/texmf-dist/tex/generic/xint/xintcore.sty
+++ b/Master/texmf-dist/tex/generic/xint/xintcore.sty
@@ -21,7 +21,7 @@
%% same distribution. (The sources need not necessarily be
%% in the same archive or directory.)
%% ---------------------------------------------------------------
-%% The xint bundle 1.2n 2017/08/06
+%% The xint bundle 1.2o 2017/08/29
%% Copyright (C) 2013-2017 by Jean-Francois Burnol
%% xintcore: Expandable arithmetic on big integers
%% ---------------------------------------------------------------
@@ -70,7 +70,7 @@
\XINTsetupcatcodes% defined in xintkernel.sty
\XINT_providespackage
\ProvidesPackage{xintcore}%
- [2017/08/06 1.2n Expandable arithmetic on big integers (JFB)]%
+ [2017/08/29 1.2o Expandable arithmetic on big integers (JFB)]%
\csname XINT_Clamped_istrapped\endcsname
\csname XINT_ConversionSyntax_istrapped\endcsname
\csname XINT_DivisionByZero_istrapped\endcsname
@@ -123,6 +123,7 @@
\XINT_resetFlag{Overflow}% not encountered so far in xint code 1.2l
% .. others ..
}%
+\def\XINT_RaiseFlag #1{\expandafter\xint_gobble_i\csname XINT_#1Flag_ON\endcsname}%
%% NOT IMPLEMENTED! WORK IN PROGRESS! (ALL SIGNALS TRAPPED, NO HANDLERS USED)
\catcode`. 11
\let\XINT_Clamped.handler\xint_firstofone % WIP
@@ -147,13 +148,19 @@
\newcount\xint_c_x^viii_mone \xint_c_x^viii_mone 99999999
\newcount\xint_c_xii_e_viii \xint_c_xii_e_viii 1200000000
\newcount\xint_c_xi_e_viii_mone \xint_c_xi_e_viii_mone 1099999999
+\def\XINT_cuz_small#1{%
+\def\XINT_cuz_small ##1##2##3##4##5##6##7##8%
+{%
+ \expandafter#1\the\numexpr ##1##2##3##4##5##6##7##8\relax
+}}\XINT_cuz_small{ }%
\def\xintiNum {\romannumeral0\xintinum }%
\def\xintinum #1%
{%
\expandafter\XINT_num_cleanup\the\numexpr\expandafter\XINT_num_loop
\romannumeral`&&@#1\xint:\xint:\xint:\xint:\xint:\xint:\xint:\xint:\xint:\Z
}%
-\let\xintNum\xintiNum \let\xintnum\xintinum
+\def\xintNum {\romannumeral0\xintnum }%
+\let\xintnum\xintinum
\def\XINT_num #1%
{%
\expandafter\XINT_num_cleanup\the\numexpr\XINT_num_loop
@@ -171,17 +178,12 @@
}%
\def\XINT_num_end\xint:#1\xint:{#1+\xint_c_\xint:}% empty input ok
\def\XINT_num_cleanup #1\xint:#2\Z { #1}%
-\def\XINT_cuz_small#1{%
-\def\XINT_cuz_small ##1##2##3##4##5##6##7##8%
-{%
- \expandafter#1\the\numexpr ##1##2##3##4##5##6##7##8\relax
-}}\XINT_cuz_small{ }%
\def\xintiiSgn {\romannumeral0\xintiisgn }%
\def\xintiisgn #1%
{%
\expandafter\XINT_sgn \romannumeral`&&@#1\xint:
}%
-\def\xintSgn {\romannumeral0\xintsgn }%
+\def\xintSgn {\romannumeral0\XINT_signaldeprecated{xintcore}{xintSgn}\xintsgn }%
\def\xintsgn #1%
{%
\expandafter\XINT_sgn \romannumeral0\xintnum{#1}\xint:
@@ -215,7 +217,7 @@
{%
\expandafter\XINT_opp \romannumeral`&&@#1%
}%
-\def\xintiOpp {\romannumeral0\xintiopp }%
+\def\xintiOpp {\romannumeral0\XINT_signaldeprecated{xintcore}{xintiOpp}\xintiopp }%
\def\xintiopp #1%
{%
\expandafter\XINT_opp \romannumeral0\xintnum{#1}%
@@ -234,7 +236,7 @@
{%
\expandafter\XINT_abs \romannumeral`&&@#1%
}%
-\def\xintiAbs {\romannumeral0\xintiabs }%
+\def\xintiAbs {\romannumeral0\XINT_signaldeprecated{xintcore}{xintiAbs}\xintiabs }%
\def\xintiabs #1%
{%
\expandafter\XINT_abs \romannumeral0\xintnum{#1}%
@@ -246,17 +248,12 @@
-{ #1}%
\krof
}%
-\def\xintiiFDg {\romannumeral0\xintiifdg }%
-\def\xintiifdg #1%
-{%
- \expandafter\XINT_fdg \romannumeral`&&@#1\xint:\Z
-}%
\def\xintFDg {\romannumeral0\xintfdg }%
-\def\xintfdg #1%
-{%
- \expandafter\XINT_fdg \romannumeral0\xintnum{#1}\xint:\Z
-}%
-\def\XINT_FDg #1{\romannumeral0\XINT_fdg #1\xint:\Z }%
+\def\xintfdg #1{\expandafter\XINT_fdg \romannumeral`&&@#1\xint:\Z}%
+\def\xintiiFDg {\romannumeral0\XINT_signaldeprecated{xintcore}{xintiiFDg}\xintiifdg }%
+\let\xintiifdg\xintfdg
+\def\XINT_FDg #1%
+ {\romannumeral0\expandafter\XINT_fdg\romannumeral`&&@\xintnum{#1}\xint:\Z }%
\def\XINT_fdg #1#2#3\Z
{%
\xint_UDzerominusfork
@@ -265,12 +262,11 @@
0-{ #1}% positive
\krof
}%
-\def\xintLDg {\romannumeral0\xintldg }%
-\def\xintldg #1{\expandafter\XINT_ldg_fork\romannumeral0\xintnum{#1}%
- \XINT_ldg_c{}{}{}{}{}{}{}{}\xint_bye\relax}%
-\def\xintiiLDg {\romannumeral0\xintiildg }%
-\def\xintiildg #1{\expandafter\XINT_ldg_fork\romannumeral`&&@#1%
+\def\xintLDg {\romannumeral0\xintldg }%
+\def\xintldg #1{\expandafter\XINT_ldg_fork\romannumeral`&&@#1%
\XINT_ldg_c{}{}{}{}{}{}{}{}\xint_bye\relax}%
+\def\xintiiLDg {\romannumeral0\XINT_signaldeprecated{xintcore}{xintiiLDg}\xintiildg }%
+\let\xintiildg\xintldg
\def\XINT_ldg_fork #1%
{%
\xint_UDsignfork
@@ -575,7 +571,7 @@
{%
\expandafter\XINT_cuz_small\xint_gob_til_sc #8#7#6#5#4#3#2#1%
}%
-\def\xintiAdd {\romannumeral0\xintiadd }%
+\def\xintiAdd {\romannumeral0\XINT_signaldeprecated{xintcore}{xintiAdd}\xintiadd }%
\def\xintiadd #1{\expandafter\XINT_iadd\romannumeral0\xintnum{#1}\xint:}%
\def\xintiiAdd {\romannumeral0\xintiiadd }%
\def\xintiiadd #1{\expandafter\XINT_iiadd\romannumeral`&&@#1\xint:}%
@@ -730,7 +726,7 @@
\def\XINT_add_m #1!{\expandafter\XINT_add_n\the\numexpr\xint_c_i+#1\xint:}%
\def\XINT_add_n #1#2\xint:{1#2\expandafter!\the\numexpr\XINT_add_o #1}%
\def\XINT_add_o #1{\if #12\expandafter\XINT_add_l\else\expandafter\XINT_add_ke \fi}%
-\def\xintCmp {\romannumeral0\xintcmp }%
+\def\xintCmp {\romannumeral0\XINT_signaldeprecated{xintcore}{xintCmp}\xintcmp }%
\def\xintcmp #1{\expandafter\XINT_icmp\romannumeral0\xintnum{#1}\xint:}%
\def\xintiiCmp {\romannumeral0\xintiicmp }%
\def\xintiicmp #1{\expandafter\XINT_iicmp\romannumeral`&&@#1\xint:}%
@@ -841,7 +837,7 @@
\expandafter\XINT_sub_nfork\expandafter
#1\romannumeral`&&@#3\xint:#2\xint:
}%
-\def\xintiSub {\romannumeral0\xintisub }%
+\def\xintiSub {\romannumeral0\XINT_signaldeprecated{xintcore}{xintiSub}\xintisub }%
\def\xintisub #1{\expandafter\XINT_isub\romannumeral0\xintnum{#1}\xint:}%
\def\XINT_isub #1#2\xint:#3%
{%
@@ -1039,7 +1035,7 @@
\the\numexpr \xint_c_xi_e_viii_mone-#1#2#3#4#5#6#7#8\XINT_sub_comp_loop
}%
\def\XINT_sub_comp_clean 1#1{+#1\relax}%
-\def\xintiMul {\romannumeral0\xintimul }%
+\def\xintiMul {\romannumeral0\XINT_signaldeprecated{xintcore}{xintiMul}\xintimul }%
\def\xintimul #1%
{%
\expandafter\XINT_imul\romannumeral0\xintnum{#1}\xint:
@@ -1215,17 +1211,7 @@
{%
1#6#7\expandafter!\the\numexpr \xint_c_x^viii+#1#2#3#4#5+#8!%
}%
-\def\xintiiQuo {\romannumeral0\xintiiquo }%
-\def\xintiiRem {\romannumeral0\xintiirem }%
-\def\xintiiquo {\expandafter\xint_firstoftwo_thenstop\romannumeral0\xintiidivision }%
-\def\xintiirem {\expandafter\xint_secondoftwo_thenstop\romannumeral0\xintiidivision }%
-\def\xintiQuo {\romannumeral0\xintiquo }%
-\def\xintiRem {\romannumeral0\xintirem }%
-\def\xintiquo {\expandafter\xint_firstoftwo_thenstop\romannumeral0\xintidivision }%
-\def\xintirem {\expandafter\xint_secondoftwo_thenstop\romannumeral0\xintidivision }%
-%%\let\xintQuo\xintiQuo\let\xintquo\xintiquo % now removed
-%%\let\xintRem\xintiRem\let\xintrem\xintirem % now removed
-\def\xintiDivision {\romannumeral0\xintidivision }%
+\def\xintiDivision {\romannumeral0\XINT_signaldeprecated{xintcore}{xintiDivision}\xintidivision }%
\def\xintidivision #1{\expandafter\XINT_idivision\romannumeral0\xintnum{#1}\xint:}%
\def\XINT_idivision #1#2\xint:#3{\expandafter\XINT_iidivision_a\expandafter #1%
\romannumeral0\xintnum{#3}\xint:#2\xint:}%
@@ -1296,7 +1282,7 @@
\def\XINT_div_BisTwo #1#2%
{%
\expandafter\expandafter\expandafter\XINT_div_BisTwo_a
- \ifodd\xintiiLDg{#2} \expandafter1\else \expandafter0\fi {#2}%
+ \ifodd\xintLDg{#2} \expandafter1\else \expandafter0\fi {#2}%
}%
\def\XINT_div_BisTwo_a #1#2%
{%
@@ -1822,7 +1808,19 @@
{%
\xint_c_x^viii_mone+#3+(#1#2+#5)/#4!%
}%
-\def\xintiDivRound {\romannumeral0\xintidivround }%
+\def\xintiiQuo {\romannumeral0\xintiiquo }%
+\def\xintiiRem {\romannumeral0\xintiirem }%
+\def\xintiiquo
+ {\expandafter\xint_firstoftwo_thenstop\romannumeral0\xintiidivision }%
+\def\xintiirem
+ {\expandafter\xint_secondoftwo_thenstop\romannumeral0\xintiidivision }%
+\def\xintiQuo {\romannumeral0\XINT_signaldeprecated{xintcore}{xintiQuo}\xintiquo }%
+\def\xintiRem {\romannumeral0\XINT_signaldeprecated{xintcore}{xintiRem}\xintirem }%
+\def\xintiquo
+ {\expandafter\xint_firstoftwo_thenstop\romannumeral0\xintidivision }%
+\def\xintirem
+ {\expandafter\xint_secondoftwo_thenstop\romannumeral0\xintidivision }%
+\def\xintiDivRound {\romannumeral0\XINT_signaldeprecated{xintcore}{xintiDivRound}\xintidivround }%
\def\xintidivround #1%
{\expandafter\XINT_idivround\romannumeral0\xintnum{#1}\xint:}%
\def\xintiiDivRound {\romannumeral0\xintiidivround }%
@@ -1863,7 +1861,7 @@
\romannumeral0\XINT_div_prepare {#2}{#1#30}%
\xint_bye\xint_Bye3456789\xint_bye/\xint_c_x\relax
}%
-\def\xintiDivTrunc {\romannumeral0\xintidivtrunc }%
+\def\xintiDivTrunc {\romannumeral0\XINT_signaldeprecated{xintcore}{xintiDivTrunc}\xintidivtrunc }%
\def\xintidivtrunc #1{\expandafter\XINT_iidivtrunc\romannumeral0\xintnum{#1}\xint:}%
\def\xintiiDivTrunc {\romannumeral0\xintiidivtrunc }%
\def\xintiidivtrunc #1{\expandafter\XINT_iidivtrunc\romannumeral`&&@#1\xint:}%
@@ -1893,7 +1891,7 @@
\def\XINT_iidivtrunc_pos #1#2\xint:#3\xint:
{\expandafter\xint_firstoftwo_thenstop
\romannumeral0\XINT_div_prepare {#2}{#1#3}}%
-\def\xintiMod {\romannumeral0\xintimod }%
+\def\xintiMod {\romannumeral0\XINT_signaldeprecated{xintcore}{xintiMod}\xintimod }%
\def\xintimod #1{\expandafter\XINT_iimod\romannumeral0\xintnum{#1}\xint:}%
\def\xintiiMod {\romannumeral0\xintiimod }%
\def\xintiimod #1{\expandafter\XINT_iimod\romannumeral`&&@#1\xint:}%
@@ -1928,7 +1926,7 @@
{%
\expandafter\XINT_sqr\romannumeral0\xintiiabs{#1}\xint:
}%
-\def\xintiSqr {\romannumeral0\xintisqr }%
+\def\xintiSqr {\romannumeral0\XINT_signaldeprecated{xintcore}{xintiSqr}\xintisqr }%
\def\xintisqr #1%
{%
\expandafter\XINT_sqr\romannumeral0\xintiabs{#1}\xint:
@@ -1977,7 +1975,7 @@
\expandafter\xint_pow\the\numexpr #2\expandafter
.\romannumeral`&&@#1\xint:
}%
-\def\xintiPow {\romannumeral0\xintipow }%
+\def\xintiPow {\romannumeral0\XINT_signaldeprecated{xintcore}{xintiPow}\xintipow }%
\def\xintipow #1#2%
{%
\expandafter\xint_pow\the\numexpr #2\expandafter
@@ -2116,8 +2114,8 @@
}%
\def\xintiiFac {\romannumeral0\xintiifac }%
\def\xintiifac #1{\expandafter\XINT_fac_fork\the\numexpr#1.}%
-\def\xintiFac {\romannumeral0\xintifac }%
-\let\xintifac\xintiifac
+\def\xintiFac {\romannumeral0\XINT_signaldeprecated{xintcore}{xintiFac}\xintifac }%
+\let\xintifac \xintiifac % redefined by xintfrac
\def\XINT_fac_fork #1#2.%
{%
\xint_UDzerominusfork
@@ -2221,17 +2219,49 @@
\xint_c_x^viii+#1*(#1+\xint_c_i)*(#1+\xint_c_ii)*(#1+\xint_c_iii)!%
}%
\def\XINT_fac_loop_exit #1!#2;!#3{#3#2;!}%
-\catcode`! 11
-\def\xintAbs {\Did_you_mean_iiAbs?or_load_xintfrac!}%
-\def\xintOpp {\Did_you_mean_iiOpp?or_load_xintfrac!}%
-\def\xintAdd {\Did_you_mean_iiAdd?or_load_xintfrac!}%
-\def\xintSub {\Did_you_mean_iiSub?or_load_xintfrac!}%
-\def\xintMul {\Did_you_mean_iiMul?or_load_xintfrac!}%
-\def\xintPow {\Did_you_mean_iiPow?or_load_xintfrac!}%
-\def\xintSqr {\Did_you_mean_iiSqr?or_load_xintfrac!}%
-\def\xintQuo {\Removed!use_xintiQuo_or_xintiiQuo!}%
-\def\xintRem {\Removed!use_xintiRem_or_xintiiRem!}%
-\catcode`! 12
+\def\XINT_signaldeprecated #1#2%
+{%
+ \XINT_ifFlagRaised{#2}%
+ {}% already encountered (if not hidden in a group...)
+ {\XINT_RaiseFlag{Deprecated-#1}\XINT_RaiseFlag{#2}%
+ \expandafter\XINT_expandableerror\expandafter
+ {\csname#2\endcsname (#1) is deprecated! (RET to proceed)}}%
+}%
+\ifdefined\documentclass\ifdefined\AtEndDocument
+ \AtEndDocument{%
+\XINT_ifFlagRaised{Deprecated-xintcore}%
+ {\PackageError{xintcore}
+{Usage of deprecated macros!}
+{These deprecated macros from xintcore.sty have been detected:\MessageBreak
+\XINT_useiimessage{xintSgn}%
+\XINT_useiimessage{xintCmp}%
+\XINT_ifFlagRaised{xintiOpp}{\string\xintiOpp\MessageBreak}{}%
+\XINT_ifFlagRaised{xintiAbs}{\string\xintiAbs\MessageBreak}{}%
+\XINT_ifFlagRaised{xintiiFDg}{\string\xintiiFDg\space(renamed to \string\xintFDg!)\MessageBreak}{}%
+\XINT_ifFlagRaised{xintiiLDg}{\string\xintiiLDg\space(renamed to \string\xintLDg!)\MessageBreak}{}%
+\XINT_ifFlagRaised{xintiAdd}{\string\xintiAdd\MessageBreak}{}%
+\XINT_ifFlagRaised{xintiSub}{\string\xintiSub\MessageBreak}{}%
+\XINT_ifFlagRaised{xintiMul}{\string\xintiMul\MessageBreak}{}%
+\XINT_ifFlagRaised{xintiDivision}{\string\xintiDivision\MessageBreak}{}%
+\XINT_ifFlagRaised{xintiQuo}{\string\xintiQuo\MessageBreak}{}%
+\XINT_ifFlagRaised{xintiRem}{\string\xintiRem\MessageBreak}{}%
+\XINT_ifFlagRaised{xintiDivRound}{\string\xintiDivRound\MessageBreak}{}%
+\XINT_ifFlagRaised{xintiDivTrunc}{\string\xintiDivTrunc\MessageBreak}{}%
+\XINT_ifFlagRaised{xintiMod}{\string\xintiMod\MessageBreak}{}%
+\XINT_ifFlagRaised{xintiSqr}{\string\xintiSqr\MessageBreak}{}%
+\XINT_ifFlagRaised{xintiPow}{\string\xintiPow\MessageBreak}{}%
+\XINT_ifFlagRaised{xintiFac}{\string\xintiFac\MessageBreak}{}%
+They will get removed at some future release.}}%
+ {% no deprecated macro used (at top level...)
+ }%
+}\fi\fi
+\def\XINT_useiimessage #1% used in LaTeX only
+{%
+ \XINT_ifFlagRaised {#1}%
+ {\@backslashchar#1
+ (load xintfrac or use \@backslashchar xintii\xint_gobble_iv#1!)\MessageBreak}%
+ {}%
+}%
\XINT_restorecatcodes_endinput%
\endinput
%%