[latex3-commits] [l3svn] r6030 - Disable division more properly in l3bigint
noreply at latex-project.org
noreply at latex-project.org
Tue Sep 22 21:27:03 CEST 2015
Author: bruno
Date: 2015-09-22 21:27:03 +0200 (Tue, 22 Sep 2015)
New Revision: 6030
Modified:
trunk/l3trial/l3bigint/l3bigint.dtx
Log:
Disable division more properly in l3bigint
Division is not implemented. I had put a quick and dirty
"\BOOM", now all knowledge of division is removed and the
error will be "unknown symbol /".
Modified: trunk/l3trial/l3bigint/l3bigint.dtx
===================================================================
--- trunk/l3trial/l3bigint/l3bigint.dtx 2015-09-22 19:08:20 UTC (rev 6029)
+++ trunk/l3trial/l3bigint/l3bigint.dtx 2015-09-22 19:27:03 UTC (rev 6030)
@@ -79,6 +79,9 @@
% functions such as computing the \texttt{gcd} of two numbers,
% \emph{etc.}
%
+% At present, division is not implemented, hence \texttt{gcd} and other
+% functions depending on it will break.
+%
% The functions implemented here could be useful to some niche users
% (\emph{e.g.}, myself when developing and debugging \pkg{l3rand})
% but loading this module is useless for the great majority of
@@ -1452,7 +1455,7 @@
\fi:
}
}
- \@@_tmp:w \@@_parse_infix_/:N / \c_ten \c_ten
+ % \@@_tmp:w \@@_parse_infix_/:N / \c_ten \c_ten
\@@_tmp:w \@@_parse_infix_*:N * \c_ten \c_ten
\@@_tmp:w \@@_parse_infix_-:N - \c_nine \c_nine
\@@_tmp:w \@@_parse_infix_+:N + \c_nine \c_nine
@@ -1701,13 +1704,20 @@
% \end{macro}
% \end{macro}
%
-% \begin{macro}[int, EXP]{\@@_+_o:ww, \@@_-_o:ww}
+% \begin{macro}[int, EXP]{\@@_return_i_o:w}
% \begin{macrocode}
-\cs_new:Npn \@@_set_sign_ii:Nw #1 #2 ; #3 . #4 { #2 ; #3 . #1 }
\cs_new:Npn \@@_return_i_o:w #1 \s_@@ #2 ; \s_@@ #3 ;
{ \@@_exp_after_o:w \s_@@ #2 ; }
\cs_new:Npn \@@_return_ii_o:w #1 \s_@@ #2 ;
{ \@@_exp_after_o:w }
+\cs_new:Npn \@@_return_zero_o:w #1 \s_@@ #2 ; \s_@@ #3 ;
+ { \exp_after:wN \c_@@_zero_bigint }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[int, EXP]{\@@_+_o:ww, \@@_-_o:ww}
+% \begin{macrocode}
+\cs_new:Npn \@@_set_sign_ii:Nw #1 #2 ; #3 . #4 { #2 ; #3 . #1 }
\cs_new:Npn \@@_num_swap:www #1 \s_@@ #2 ; \s_@@ #3 ; { #1 \s_@@ #3 ; \s_@@ #2 ; }
\use:x
{
@@ -2175,21 +2185,11 @@
%
% \subsection{Division, rounded and truncated}
%
-% \begin{macro}[int, EXP]{\@@_/_o:ww}
-% ^^A todo: do better than \BOOM!
-% ^^A todo: missing!
-% \begin{macrocode}
-\cs_new:cpn { @@_/_o:ww } \s_@@ \@@_chk:w #1.#2#3 ; \s_@@ \@@_chk:w #4.#5
- {
- \BOOM\BOOM\prg_replicate:nn{\c_max_int}{\BOOM}
- \if_meaning:w 0 #4 \BOOM \exp_after:wN \@@_return_ii_o:w \fi:
- \if_meaning:w 0 #1 \exp_after:wN \@@_return_i_o:w \fi:
- \@@_div_aux_o:ww
- \s_@@ \@@_chk:w #1.#2 #3 ;
- \s_@@ \@@_chk:w #4.#5
- }
-% \end{macrocode}
-% \end{macro}
+% Will be based on [Christoph Burnikel and Joachim Ziegler. Fast
+% Recursive Division. Research Report MPI-I-98-1-022,
+% Max-Planck-Institut f\"ur Informatik, Im Stadtwald, D-66123
+% Saarbr\"ucken, Germany, October 1998], but with a lot of boiler-plate
+% code due to writing this in \TeX{}.
%
% \subsection{Big integer expressions}
%
@@ -3015,9 +3015,11 @@
%
% \subsection{Messages}
%
+% Be careful that |#1| may be very long, so give a meaningful message
+% before |#1|.
% \begin{macrocode}
\msg_new:nnn { bigint } { division-by-zero }
- { Division~of~#1~by~zero. }
+ { Division~by~zero:~#1/0. }
% \end{macrocode}
%
% \end{implementation}
More information about the latex3-commits
mailing list