texlive[73546] Master/texmf-dist: siunitx (21jan25)

commits+karl at tug.org commits+karl at tug.org
Tue Jan 21 21:45:34 CET 2025


Revision: 73546
          https://tug.org/svn/texlive?view=revision&revision=73546
Author:   karl
Date:     2025-01-21 21:45:34 +0100 (Tue, 21 Jan 2025)
Log Message:
-----------
siunitx (21jan25)

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-complex.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	2025-01-21 19:15:28 UTC (rev 73545)
+++ trunk/Master/texmf-dist/doc/latex/siunitx/CHANGELOG.md	2025-01-21 20:45:34 UTC (rev 73546)
@@ -7,6 +7,13 @@
 
 ## [Unreleased]
 
+## [v3.4.4] - 2025-01-21
+
+### Fixed
+- Handling of mixed exponents in converting complex values from polar to
+  Cartesian form (see issue
+  [\#774](https://github.com/josephwright/siunitx/issues/774))
+
 ## [v3.4.3] - 2025-01-20
 
 ### Fixed
@@ -2228,7 +2235,8 @@
 ### Added
 - First public testing release (as `si`)
 
-[Unreleased]: https://github.com/josephwright/siunitx/compare/v3.4.3...HEAD
+[Unreleased]: https://github.com/josephwright/siunitx/compare/v3.4.4...HEAD
+[v3.4.4]: https://github.com/josephwright/siunitx/compare/v3.4.3...v3.4.4
 [v3.4.3]: https://github.com/josephwright/siunitx/compare/v3.4.2...v3.4.3
 [v3.4.2]: https://github.com/josephwright/siunitx/compare/v3.4.1...v3.4.2
 [v3.4.1]: https://github.com/josephwright/siunitx/compare/v3.4.0...v3.4.1

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-complex.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/siunitx/siunitx-complex.dtx	2025-01-21 19:15:28 UTC (rev 73545)
+++ trunk/Master/texmf-dist/source/latex/siunitx/siunitx-complex.dtx	2025-01-21 20:45:34 UTC (rev 73546)
@@ -1107,8 +1107,15 @@
 %     \@@_convert_cartesian_aux:ee
 %   }
 % \begin{macro}[EXP]{\@@_convert_cartesian_aux:w}
+% \begin{macro}[EXP]
+%   {
+%     \@@_convert_cartesian_aux:nnn ,
+%     \@@_convert_cartesian_aux:nen ,
+%     \@@_convert_cartesian_aux:enn
+%   }
 %   Conversion to Cartesian form is easy as we have two inputs and need to
-%   do no parsing here at all.
+%   do no parsing here at all. In most cases the exponents for the two
+%   output parts will be the same, but that is not certain.
 %    \begin{macrocode}
 \cs_new:Npn \@@_convert_cartesian:nn #1#2
   {
@@ -1124,25 +1131,47 @@
   }
 \cs_new:Npn \@@_convert_cartesian_aux:nn #1#2
   {
-    \@@_convert_cartesian_aux:w #1 e e \q_mark #2 e e \q_stop
+    \@@_convert_cartesian_aux:w #1 e 0 e \q_mark #2 e 0 e \q_stop
   }
 \cs_generate_variant:Nn \@@_convert_cartesian_aux:nn { ee }
 \cs_new:Npn \@@_convert_cartesian_aux:w
   #1 e #2 e #3 \q_mark #4 e #5 e #6 \q_stop
   {
+    \int_compare:nNnTF {#2} = {#5}
+      { \@@_convert_cartesian_aux:nnn {#1} {#4} {#2} }
+      {
+        \int_compare:nNnTF {#2} > {#5}
+          {
+            \@@_convert_cartesian_aux:nen
+              {#1}
+              { \fp_to_decimal:n { #4 * 10 ** (#5 - #2) } }
+              {#2}
+          }
+          {
+            \@@_convert_cartesian_aux:enn
+              { \fp_to_decimal:n { #1 * 10 ** (#2 - #5) } }
+              {#4}
+              {#5}
+          }
+      }
+  }
+\cs_new:Npn \@@_convert_cartesian_aux:nnn #1#2#3
+  {
     \fp_compare:nNnF {#1} = \c_zero_fp
       {#1}
-    \fp_compare:nNnF {#4} = \c_zero_fp
+    \fp_compare:nNnF {#2} = \c_zero_fp
       {
-        \fp_compare:nNnF {#4} < \c_zero_fp { + }
-        #4 i
+        \fp_compare:nNnF {#2} < \c_zero_fp { + }
+        #2 i
       }
-    \tl_if_blank:nF {#2}
-      { e #2 }
+    \int_compare:nNnF {#3} = 0
+      { e #3 }
   }
+\cs_generate_variant:Nn \@@_convert_cartesian_aux:nnn { e , ne }
 %    \end{macrocode}
 % \end{macro}
 % \end{macro}
+% \end{macro}
 %
 % \begin{macro}[EXP]{\@@_convert_polar:n}
 % \begin{macro}[EXP]{\@@_convert_polar_auxi:w}

Modified: trunk/Master/texmf-dist/source/latex/siunitx/siunitx.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/siunitx/siunitx.dtx	2025-01-21 19:15:28 UTC (rev 73545)
+++ trunk/Master/texmf-dist/source/latex/siunitx/siunitx.dtx	2025-01-21 20:45:34 UTC (rev 73546)
@@ -137,7 +137,7 @@
 %
 % Identify the package and give the over all version information.
 %    \begin{macrocode}
-\ProvidesExplPackage {siunitx} {2025-01-20} {3.4.3}
+\ProvidesExplPackage {siunitx} {2025-01-21} {3.4.4}
   {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	2025-01-21 19:15:28 UTC (rev 73545)
+++ trunk/Master/texmf-dist/tex/latex/siunitx/siunitx.sty	2025-01-21 20:45:34 UTC (rev 73546)
@@ -47,7 +47,7 @@
       }%
     \endinput
   }%
-\ProvidesExplPackage {siunitx} {2025-01-20} {3.4.3}
+\ProvidesExplPackage {siunitx} {2025-01-21} {3.4.4}
   {A comprehensive (SI) units package}
 \msg_new:nnnn { siunitx } { incompatible-package }
   { Package~'#1'~incompatible. }
@@ -4000,22 +4000,43 @@
   }
 \cs_new:Npn \__siunitx_complex_convert_cartesian_aux:nn #1#2
   {
-    \__siunitx_complex_convert_cartesian_aux:w #1 e e \q_mark #2 e e \q_stop
+    \__siunitx_complex_convert_cartesian_aux:w #1 e 0 e \q_mark #2 e 0 e \q_stop
   }
 \cs_generate_variant:Nn \__siunitx_complex_convert_cartesian_aux:nn { ee }
 \cs_new:Npn \__siunitx_complex_convert_cartesian_aux:w
   #1 e #2 e #3 \q_mark #4 e #5 e #6 \q_stop
   {
+    \int_compare:nNnTF {#2} = {#5}
+      { \__siunitx_complex_convert_cartesian_aux:nnn {#1} {#4} {#2} }
+      {
+        \int_compare:nNnTF {#2} > {#5}
+          {
+            \__siunitx_complex_convert_cartesian_aux:nen
+              {#1}
+              { \fp_to_decimal:n { #4 * 10 ** (#5 - #2) } }
+              {#2}
+          }
+          {
+            \__siunitx_complex_convert_cartesian_aux:enn
+              { \fp_to_decimal:n { #1 * 10 ** (#2 - #5) } }
+              {#4}
+              {#5}
+          }
+      }
+  }
+\cs_new:Npn \__siunitx_complex_convert_cartesian_aux:nnn #1#2#3
+  {
     \fp_compare:nNnF {#1} = \c_zero_fp
       {#1}
-    \fp_compare:nNnF {#4} = \c_zero_fp
+    \fp_compare:nNnF {#2} = \c_zero_fp
       {
-        \fp_compare:nNnF {#4} < \c_zero_fp { + }
-        #4 i
+        \fp_compare:nNnF {#2} < \c_zero_fp { + }
+        #2 i
       }
-    \tl_if_blank:nF {#2}
-      { e #2 }
+    \int_compare:nNnF {#3} = 0
+      { e #3 }
   }
+\cs_generate_variant:Nn \__siunitx_complex_convert_cartesian_aux:nnn { e , ne }
 \cs_new:Npn \__siunitx_complex_convert_polar:n #1
   { \__siunitx_complex_convert_polar_auxi:w #1 e e \q_stop }
 \cs_new:Npn \__siunitx_complex_convert_polar_auxi:w #1 e #2 e #3 \q_stop



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