summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/bnumexpr
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2014-10-29 22:33:12 +0000
committerKarl Berry <karl@freefriends.org>2014-10-29 22:33:12 +0000
commit99d98e0491e7e6534c414cf552ecfafee17bd20f (patch)
treede6dfd32a50bb433bd88547e86d38820fd6c01b5 /Master/texmf-dist/tex/latex/bnumexpr
parent836bd572a38295459c8201f029bda32baf5a4b38 (diff)
bnumexpr (29oct14)
git-svn-id: svn://tug.org/texlive/trunk@35466 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/bnumexpr')
-rw-r--r--Master/texmf-dist/tex/latex/bnumexpr/bnumexpr.sty66
1 files changed, 15 insertions, 51 deletions
diff --git a/Master/texmf-dist/tex/latex/bnumexpr/bnumexpr.sty b/Master/texmf-dist/tex/latex/bnumexpr/bnumexpr.sty
index f10bc5da65f..ad782b7bb2b 100644
--- a/Master/texmf-dist/tex/latex/bnumexpr/bnumexpr.sty
+++ b/Master/texmf-dist/tex/latex/bnumexpr/bnumexpr.sty
@@ -20,24 +20,28 @@
%% 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 bnumexpr package: Expressions with big integers
%% Copyright (C) 2014 by Jean-Francois Burnol
-%%----------------------------------------------------------------
+%%
\NeedsTeXFormat{LaTeX2e}%
-\ProvidesPackage{bnumexpr}[2014/09/22 v1.1a Expressions with big integers (jfB)]%
+\ProvidesPackage{bnumexpr}[2014/10/28 v1.1b Expressions with big integers (jfB)]%
\edef\BNErestorecatcodes {\catcode`\noexpand\!\the\catcode`\!
\catcode`\noexpand\?\the\catcode`\?
\catcode`\noexpand\_\the\catcode`\_
- \catcode`\noexpand\:\the\catcode`\:\relax }%
-\catcode`\! 11 % some other catcodes will be manipulated: comma, (, ),
-\catcode`\? 11 % but we reset them to their standard values, thus
-\catcode`\_ 11 % \BNErestorecatcodes is a bit pedantic here.
+ \catcode`\noexpand\:\the\catcode`\:
+ \catcode`\noexpand\(\the\catcode`\(
+ \catcode`\noexpand\)\the\catcode`\)
+ \catcode`\noexpand\*\the\catcode`\*
+ \catcode`\noexpand\,\the\catcode`\,\relax }%
+\catcode`\! 11
+\catcode`\? 11
+\catcode`\_ 11
\catcode`\: 11
\def\BNE_tmpa {0}%
\DeclareOption {custom}{\def\BNE_tmpa {1}%
\PackageWarningNoLine{bnumexpr}{^^J
- Option custom: package xint not loaded. Definitions are needed for:^^J
+ Option custom: package xintcore not loaded. Definitions are needed for:^^J
\protect\bnumexprAdd, \protect\bnumexprSub,
\protect\bnumexprMul\space and \protect\bnumexprDiv }%
}%
@@ -70,7 +74,7 @@
\let\bnumexprAdd\xintiiAdd
\let\bnumexprSub\xintiiSub
\let\bnumexprMul\xintiiMul
- \let\bnumexprDiv\BNE_xintiiDivRound
+ \let\bnumexprDiv\xintiiDivRound
\let\bnumexprPow\xintiiPow
}%
\def\bnumexprUsesbigintcalc {%
@@ -87,48 +91,8 @@
\let\bnumexprDiv\bigint_div_round:nn
\let\bnumexprPow\bigint_pow:nn % does not exist!
}%
-\def\BNE_xintiiDivRound {\romannumeral0\BNE_xintiidivround }%
-\def\BNE_xintiidivround #1{\expandafter\BNE_div \romannumeral-`0#1\Z }%
-\def\BNE_div #1#2\Z #3{\expandafter\BNE_div_a\expandafter #1%
- \romannumeral-`0#3\Z #2\Z }%
-\def\BNE_div_a #1#2% #1 de A, #2 de B.
-{%
- \if0#2\xint_dothis\BNE_div_divbyzero\fi
- \if0#1\xint_dothis\BNE_div_aiszero\fi
- \if-#2\xint_dothis{\BNE_div_bneg #1}\fi
- \xint_orthat{\BNE_div_bpos #1#2}%
-}%
-\def\BNE_div_divbyzero #1\Z #2\Z {\BNE:DivisionByZero\space 0}%
-\def\BNE_div_aiszero #1\Z #2\Z { 0}%
-\def\BNE_div_bpos #1%
-{%
- \xint_UDsignfork
- #1{\xintiiopp\BNE_div_pos {}}%
- -{\BNE_div_pos #1}%
- \krof
-}%
-\def\BNE_div_bneg #1%
-{%
- \xint_UDsignfork
- #1{\BNE_div_pos {}}%
- -{\xintiiopp\BNE_div_pos #1}%
- \krof
-}%
-\def\BNE_div_pos #1#2\Z #3\Z{\expandafter\BNE_div_pos_a
- \romannumeral0\XINT_div_prepare {#2}{#1#30}}%
-\def\BNE_div_pos_a #1#2{\xintReverseOrder {#1\BNE_div_pos_b}\Z }%
-\def\BNE_div_pos_b #1#2{\xint_gob_til_Z #2\BNE_div_pos_small\Z
- \BNE_div_pos_c #1#2}%
-\def\BNE_div_pos_c #1#2\Z {\ifnum #1>\xint_c_iv
- \expandafter\BNE_div_pos_up
- \else \expandafter\xintreverseorder
- \fi {#2}}%
-\def\BNE_div_pos_up #1{\xintinc {\xintReverseOrder{#1}}}%
-\def\BNE_div_pos_small\Z\BNE_div_pos_c #1#2{\ifnum #1>\xint_c_iv\expandafter
- \xint_secondoftwo\else\expandafter
- \xint_firstoftwo\fi { 0}{ 1}}%
-\if0\BNE_tmpa % Toggle to load xint.sty (and also xinttools.sty)
- \RequirePackage{xint}%
+\if0\BNE_tmpa % Toggle to load xintcore.sty
+ \RequirePackage{xintcore}%
\bnumexprUsesxint
\fi
\if2\BNE_tmpa % Toggle to load bigintcalc.sty