texlive[64080] Master/texmf-dist: siunitx (8aug22)

commits+karl at tug.org commits+karl at tug.org
Mon Aug 8 23:00:04 CEST 2022


Revision: 64080
          http://tug.org/svn/texlive?view=revision&revision=64080
Author:   karl
Date:     2022-08-08 23:00:04 +0200 (Mon, 08 Aug 2022)
Log Message:
-----------
siunitx (8aug22)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/siunitx/CHANGELOG.md
    trunk/Master/texmf-dist/doc/latex/siunitx/siunitx-code.pdf
    trunk/Master/texmf-dist/doc/latex/siunitx/siunitx.pdf
    trunk/Master/texmf-dist/source/latex/siunitx/siunitx-number.dtx
    trunk/Master/texmf-dist/source/latex/siunitx/siunitx.dtx
    trunk/Master/texmf-dist/tex/latex/siunitx/siunitx.sty

Modified: trunk/Master/texmf-dist/doc/latex/siunitx/CHANGELOG.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/siunitx/CHANGELOG.md	2022-08-08 20:59:47 UTC (rev 64079)
+++ trunk/Master/texmf-dist/doc/latex/siunitx/CHANGELOG.md	2022-08-08 21:00:04 UTC (rev 64080)
@@ -7,6 +7,14 @@
 
 ## [Unreleased]
 
+## [v3.1.6] - 2022-08-08
+
+### Fixed
+- Rounding to uncertainty where the last uncertainty digit is zero (see issue
+  [\#616](https://github.com/josephwright/siunitx/issues/616))
+- Rounding to uncertainty which is bigger than the value (see issue
+  [\#617](https://github.com/josephwright/siunitx/issues/617))
+
 ## [v3.1.5] - 2022-07-23
 
 ### Fixed
@@ -1798,7 +1806,8 @@
 ### Added
 - First public testing release (as `si`)
 
-[Unreleased]: https://github.com/josephwright/siunitx/compare/v3.1.5...HEAD
+[Unreleased]: https://github.com/josephwright/siunitx/compare/v3.1.6...HEAD
+[v3.1.6]: https://github.com/josephwright/siunitx/compare/v3.1.5...v3.1.6
 [v3.1.5]: https://github.com/josephwright/siunitx/compare/v3.1.4...v3.1.5
 [v3.1.4]: https://github.com/josephwright/siunitx/compare/v3.1.3...v3.1.4
 [v3.1.3]: https://github.com/josephwright/siunitx/compare/v3.1.2...v3.1.3

Modified: trunk/Master/texmf-dist/doc/latex/siunitx/siunitx-code.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/siunitx/siunitx.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/source/latex/siunitx/siunitx-number.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/siunitx/siunitx-number.dtx	2022-08-08 20:59:47 UTC (rev 64079)
+++ trunk/Master/texmf-dist/source/latex/siunitx/siunitx-number.dtx	2022-08-08 21:00:04 UTC (rev 64080)
@@ -3061,6 +3061,9 @@
 % \begin{macro}[EXP]{\@@_round_uncertainty:nnnnnnn}
 % \begin{macro}[EXP]{\@@_round_uncertainty_end:nn}
 % \begin{macro}[EXP]{\@@_round_uncertainty:nnn}
+% \begin{macro}[EXP]{\@@_round_uncertainty_check:nnnw}
+% \begin{macro}[EXP]{\@@_round_uncertainty_check:Nnnnw}
+% \begin{macro}[EXP]{\@@_round_uncertainty_aux:nnn}
 % \begin{macro}[EXP]{\@@_round_uncertainty:nnnn}
 % \begin{macro}[EXP]{\@@_round_uncertainty:nnnnn}
 % \begin{macro}[EXP]
@@ -3108,11 +3111,35 @@
 \cs_new:Npn \@@_round_uncertainty_end:nn #1#2
   { \exp_not:n { {#1} {#2} } }
 %    \end{macrocode}
+%   Before doing any rounding, we need to be sure that the main value has
+%   enough significant digits. If not, the result is zero.
+%    \begin{macrocode}
+\cs_new:Npn \__siunitx_number_round_uncertainty:nnn #1#2#3
+  {
+     \@@_round_uncertainty_check:nnnw {#1} {#2} {#3}
+       #1#2 \q_recursion_tail \q_recursion_stop
+  }
+\cs_new:Npn \@@_round_uncertainty_check:nnnw #1#2#3#4
+  {
+    \quark_if_recursion_tail_stop_do:Nn #4 { { 0 } { } { } }
+    \int_compare:nNnTF {#4} = 0
+      { \@@_round_uncertainty_check:nnnw }
+      { \@@_round_uncertainty_check:Nnnnw #4 }
+        {#1} {#2} {#3}
+  }
+\cs_new:Npn \@@_round_uncertainty_check:Nnnnw #1#2#3#4#5
+  \q_recursion_tail \q_recursion_stop
+  {
+    \int_compare:nNnTF { \tl_count:n {#1#5} } < { \tl_count:n {#4} }
+      { { 0 } { } { } }
+      { \@@_round_uncertainty_aux:nnn {#2} {#3} {#4} }
+  }
+%    \end{macrocode}
 %   Round the uncertainty first: this is needed to get the number of places
 %   correct. Once that is done, it's just a question of working out the digits
 %   in the main part.
 %    \begin{macrocode}
-\cs_new:Npn \@@_round_uncertainty:nnn #1#2#3
+\cs_new:Npn \@@_round_uncertainty_aux:nnn #1#2#3
   {
     \exp_args:Nf \@@_round_uncertainty:nnnn
       {
@@ -3123,9 +3150,12 @@
   }
 \cs_new:Npn \@@_round_uncertainty:nnnn #1#2#3#4
   {
-    \exp_last_unbraced:Nf \@@_round_uncertainty:nnnnn
-      { \@@_round:nnn {#1} { } {#4} }
-      {#2} {#3} {#1}
+    \use:e
+      {
+        \exp_not:N \@@_round_uncertainty:nnnnn
+          \@@_round:nnn {#1} { } {#4}
+          {#2} {#3} {#1}
+      }
   }
 %    \end{macrocode}
 %   Here, we need to work out how many digits to zero-fill the uncertainty, for
@@ -3276,6 +3306,9 @@
 % \end{macro}
 % \end{macro}
 % \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
 %
 % \begin{macro}{\@@_zero_decimal:NN}
 % \begin{macro}[EXP]{\@@_zero_decimal:nnnnnnn}

Modified: trunk/Master/texmf-dist/source/latex/siunitx/siunitx.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/siunitx/siunitx.dtx	2022-08-08 20:59:47 UTC (rev 64079)
+++ trunk/Master/texmf-dist/source/latex/siunitx/siunitx.dtx	2022-08-08 21:00:04 UTC (rev 64080)
@@ -121,7 +121,7 @@
 %
 % Identify the package and give the over all version information.
 %    \begin{macrocode}
-\ProvidesExplPackage {siunitx} {2022-07-23} {3.1.5}
+\ProvidesExplPackage {siunitx} {2022-08-08} {3.1.6}
   {A comprehensive (SI) units package}
 %    \end{macrocode}
 %

Modified: trunk/Master/texmf-dist/tex/latex/siunitx/siunitx.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/siunitx/siunitx.sty	2022-08-08 20:59:47 UTC (rev 64079)
+++ trunk/Master/texmf-dist/tex/latex/siunitx/siunitx.sty	2022-08-08 21:00:04 UTC (rev 64080)
@@ -42,7 +42,7 @@
       }%
     \endinput
   }%
-\ProvidesExplPackage {siunitx} {2022-07-23} {3.1.5}
+\ProvidesExplPackage {siunitx} {2022-08-08} {3.1.6}
   {A comprehensive (SI) units package}
 \msg_new:nnnn { siunitx } { incompatible-package }
   { Package~'#1'~incompatible. }
@@ -3309,6 +3309,26 @@
   { \exp_not:n { {#1} {#2} } }
 \cs_new:Npn \__siunitx_number_round_uncertainty:nnn #1#2#3
   {
+     \__siunitx_number_round_uncertainty_check:nnnw {#1} {#2} {#3}
+       #1#2 \q_recursion_tail \q_recursion_stop
+  }
+\cs_new:Npn \__siunitx_number_round_uncertainty_check:nnnw #1#2#3#4
+  {
+    \quark_if_recursion_tail_stop_do:Nn #4 { { 0 } { } { } }
+    \int_compare:nNnTF {#4} = 0
+      { \__siunitx_number_round_uncertainty_check:nnnw }
+      { \__siunitx_number_round_uncertainty_check:Nnnnw #4 }
+        {#1} {#2} {#3}
+  }
+\cs_new:Npn \__siunitx_number_round_uncertainty_check:Nnnnw #1#2#3#4#5
+  \q_recursion_tail \q_recursion_stop
+  {
+    \int_compare:nNnTF { \tl_count:n {#1#5} } < { \tl_count:n {#4} }
+      { { 0 } { } { } }
+      { \__siunitx_number_round_uncertainty_aux:nnn {#2} {#3} {#4} }
+  }
+\cs_new:Npn \__siunitx_number_round_uncertainty_aux:nnn #1#2#3
+  {
     \exp_args:Nf \__siunitx_number_round_uncertainty:nnnn
       {
         \int_eval:n
@@ -3318,9 +3338,12 @@
   }
 \cs_new:Npn \__siunitx_number_round_uncertainty:nnnn #1#2#3#4
   {
-    \exp_last_unbraced:Nf \__siunitx_number_round_uncertainty:nnnnn
-      { \__siunitx_number_round:nnn {#1} { } {#4} }
-      {#2} {#3} {#1}
+    \use:e
+      {
+        \exp_not:N \__siunitx_number_round_uncertainty:nnnnn
+          \__siunitx_number_round:nnn {#1} { } {#4}
+          {#2} {#3} {#1}
+      }
   }
 \cs_new:Npn \__siunitx_number_round_uncertainty:nnnnn #1#2#3#4#5
   {



More information about the tex-live-commits mailing list.