From 529294ab32f8cf8144b8125395c0c0d14c4fe78b Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Fri, 20 Jan 2012 23:04:33 +0000 Subject: siunitx (20jan12) git-svn-id: svn://tug.org/texlive/trunk@25166 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/latex/siunitx/siunitx.pdf | Bin 572505 -> 572833 bytes Master/texmf-dist/source/latex/siunitx/siunitx.dtx | 30 +++++++++++++++++---- .../latex/siunitx/config/siunitx-abbreviations.cfg | 2 +- .../tex/latex/siunitx/config/siunitx-binary.cfg | 2 +- .../tex/latex/siunitx/config/siunitx-version-1.cfg | 2 +- Master/texmf-dist/tex/latex/siunitx/siunitx.sty | 17 ++++++++++-- 6 files changed, 43 insertions(+), 10 deletions(-) (limited to 'Master') diff --git a/Master/texmf-dist/doc/latex/siunitx/siunitx.pdf b/Master/texmf-dist/doc/latex/siunitx/siunitx.pdf index 811955d61e3..52d4bc99a52 100644 Binary files a/Master/texmf-dist/doc/latex/siunitx/siunitx.pdf and b/Master/texmf-dist/doc/latex/siunitx/siunitx.pdf differ diff --git a/Master/texmf-dist/source/latex/siunitx/siunitx.dtx b/Master/texmf-dist/source/latex/siunitx/siunitx.dtx index 1522c11b718..3c63dd6e44f 100644 --- a/Master/texmf-dist/source/latex/siunitx/siunitx.dtx +++ b/Master/texmf-dist/source/latex/siunitx/siunitx.dtx @@ -560,6 +560,8 @@ This work consists of the file siunitx.dtx % which caused issues with some tokens in numerical arguments} %\changes{v2.4h}{2012/01/15}{Bug fix for implementation of % \opt{reciprocal-positive-first}} +%\changes{v2.4i}{2012/01/19}{Bug fix for rounding with large numbers of +% decimal places} % %\begin{abstract} % Physical quantities have both numbers and units, and each physical @@ -5013,7 +5015,7 @@ This work consists of the file siunitx.dtx % % The usual preliminaries. % \begin{macrocode} -\ProvidesExplPackage {siunitx} {2012/01/15} {2.4h} +\ProvidesExplPackage {siunitx} {2012/01/19} {2.4i} {A comprehensive (SI) units package} % \end{macrocode} % @@ -8241,6 +8243,7 @@ This work consists of the file siunitx.dtx % { % \siunitx_number_process_places_init:n , % \siunitx_number_process_places_aux_i:n , +% \siunitx_number_process_places_aux_i:TF , % \siunitx_number_process_places_none: , % \siunitx_number_process_places_aux_ii:n , % \siunitx_number_process_places_loop:n , @@ -8269,7 +8272,7 @@ This work consists of the file siunitx.dtx { \tl_if_empty:NT \l_siunitx_tmpa_tl { \tl_set:Nn \l_siunitx_tmpa_tl { 0 } } - \int_compare:nNnTF \l_siunitx_tmpa_tl = \c_zero + \siunitx_number_process_places_aux_i:TF { \prop_put:Nnn \l_siunitx_number_in_prop { #1 -decimal } { } \int_set:Nn \l_siunitx_round_int @@ -8285,6 +8288,23 @@ This work consists of the file siunitx.dtx } } % \end{macrocode} +% The number of digits in the decimal part could be more that \TeX{} can +% handle, so a slow loop is used to see if we need to round. +% \begin{macrocode} +\cs_new_protected:Npn \siunitx_number_process_places_aux_i:TF + { + \bool_set_true:N \l_siunitx_tmp_bool + \tl_map_inline:Nn \l_siunitx_tmpa_tl + { + \int_compare:nNnF {##1} = \c_zero + { + \bool_set_false:N \l_siunitx_tmp_bool + \tl_map_break: + } + } + \bool_if:NTF \l_siunitx_tmp_bool + } +% \end{macrocode} % Rounding to no places at all requires a few checks to see if there is any % work to do. That includes a check for rounding half to even, where if % the decimal part is exactly half then special action is required. @@ -16234,7 +16254,7 @@ This work consists of the file siunitx.dtx % \end{macrocode} % % \begin{macrocode} -\ProvidesExplFile {siunitx-version-1.cfg} {2012/01/15} {2.4h} +\ProvidesExplFile {siunitx-version-1.cfg} {2012/01/19} {2.4i} {siunitx: Version 1 settings} % \end{macrocode} % @@ -17179,7 +17199,7 @@ This work consists of the file siunitx.dtx % \end{macrocode} % % \begin{macrocode} -\ProvidesExplFile {siunitx-abbreviations.cfg} {2012/01/15} {2.4h} +\ProvidesExplFile {siunitx-abbreviations.cfg} {2012/01/19} {2.4i} {siunitx: Abbreviated units} % \end{macrocode} % @@ -17361,7 +17381,7 @@ This work consists of the file siunitx.dtx % \end{macrocode} % % \begin{macrocode} -\ProvidesExplFile {siunitx-binary.cfg} {2012/01/15} {2.4h} +\ProvidesExplFile {siunitx-binary.cfg} {2012/01/19} {2.4i} {siunitx: Binary units} % \end{macrocode} % diff --git a/Master/texmf-dist/tex/latex/siunitx/config/siunitx-abbreviations.cfg b/Master/texmf-dist/tex/latex/siunitx/config/siunitx-abbreviations.cfg index 53e1c88d4d6..59e15192e21 100644 --- a/Master/texmf-dist/tex/latex/siunitx/config/siunitx-abbreviations.cfg +++ b/Master/texmf-dist/tex/latex/siunitx/config/siunitx-abbreviations.cfg @@ -13,7 +13,7 @@ %% See http://www.latex-project.org/lppl.txt %% --------------------------------------------------------------- %% -\ProvidesExplFile {siunitx-abbreviations.cfg} {2012/01/15} {2.4h} +\ProvidesExplFile {siunitx-abbreviations.cfg} {2012/01/19} {2.4i} {siunitx: Abbreviated units} \DeclareSIUnit \A { \ampere } \DeclareSIUnit \pA { \pico \ampere } diff --git a/Master/texmf-dist/tex/latex/siunitx/config/siunitx-binary.cfg b/Master/texmf-dist/tex/latex/siunitx/config/siunitx-binary.cfg index eea6192cbb3..94a1ad42855 100644 --- a/Master/texmf-dist/tex/latex/siunitx/config/siunitx-binary.cfg +++ b/Master/texmf-dist/tex/latex/siunitx/config/siunitx-binary.cfg @@ -13,7 +13,7 @@ %% See http://www.latex-project.org/lppl.txt %% --------------------------------------------------------------- %% -\ProvidesExplFile {siunitx-binary.cfg} {2012/01/15} {2.4h} +\ProvidesExplFile {siunitx-binary.cfg} {2012/01/19} {2.4i} {siunitx: Binary units} \DeclareBinaryPrefix \kibi { Ki } { 10 } \DeclareBinaryPrefix \mebi { Mi } { 20 } diff --git a/Master/texmf-dist/tex/latex/siunitx/config/siunitx-version-1.cfg b/Master/texmf-dist/tex/latex/siunitx/config/siunitx-version-1.cfg index 1058d41c1de..72ce7678208 100644 --- a/Master/texmf-dist/tex/latex/siunitx/config/siunitx-version-1.cfg +++ b/Master/texmf-dist/tex/latex/siunitx/config/siunitx-version-1.cfg @@ -13,7 +13,7 @@ %% See http://www.latex-project.org/lppl.txt %% --------------------------------------------------------------- %% -\ProvidesExplFile {siunitx-version-1.cfg} {2012/01/15} {2.4h} +\ProvidesExplFile {siunitx-version-1.cfg} {2012/01/19} {2.4i} {siunitx: Version 1 settings} \keys_define:nn { siunitx } { addsign .choice: , diff --git a/Master/texmf-dist/tex/latex/siunitx/siunitx.sty b/Master/texmf-dist/tex/latex/siunitx/siunitx.sty index 64d373f3f83..4f766135a37 100644 --- a/Master/texmf-dist/tex/latex/siunitx/siunitx.sty +++ b/Master/texmf-dist/tex/latex/siunitx/siunitx.sty @@ -14,7 +14,7 @@ %% --------------------------------------------------------------- %% \RequirePackage{expl3} -\ProvidesExplPackage {siunitx} {2012/01/15} {2.4h} +\ProvidesExplPackage {siunitx} {2012/01/19} {2.4i} {A comprehensive (SI) units package} \@ifpackagelater { expl3 } { 2011/09/05 } { } @@ -2170,7 +2170,7 @@ { \tl_if_empty:NT \l_siunitx_tmpa_tl { \tl_set:Nn \l_siunitx_tmpa_tl { 0 } } - \int_compare:nNnTF \l_siunitx_tmpa_tl = \c_zero + \siunitx_number_process_places_aux_i:TF { \prop_put:Nnn \l_siunitx_number_in_prop { #1 -decimal } { } \int_set:Nn \l_siunitx_round_int @@ -2185,6 +2185,19 @@ } } } +\cs_new_protected:Npn \siunitx_number_process_places_aux_i:TF + { + \bool_set_true:N \l_siunitx_tmp_bool + \tl_map_inline:Nn \l_siunitx_tmpa_tl + { + \int_compare:nNnF {##1} = \c_zero + { + \bool_set_false:N \l_siunitx_tmp_bool + \tl_map_break: + } + } + \bool_if:NTF \l_siunitx_tmp_bool + } \cs_new_protected:Npn \siunitx_number_process_places_none:n #1 { \prop_get:NnNT \l_siunitx_number_in_prop { #1 -decimal } \l_siunitx_tmpa_tl -- cgit v1.2.3