summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/siunitx
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2022-10-05 03:01:34 +0000
committerNorbert Preining <norbert@preining.info>2022-10-05 03:01:34 +0000
commit6925a15396a955498e1d1663204e7fa7da3d1728 (patch)
tree925ce3e30472ef82315230ec2772e2e104642541 /macros/latex/contrib/siunitx
parent30b3429f0e138c93c5f1ba1d1a6d46728c0943e9 (diff)
CTAN sync 202210050301
Diffstat (limited to 'macros/latex/contrib/siunitx')
-rw-r--r--macros/latex/contrib/siunitx/CHANGELOG.md9
-rw-r--r--macros/latex/contrib/siunitx/siunitx-code.pdfbin617808 -> 617674 bytes
-rw-r--r--macros/latex/contrib/siunitx/siunitx-number.dtx40
-rw-r--r--macros/latex/contrib/siunitx/siunitx.dtx2
-rw-r--r--macros/latex/contrib/siunitx/siunitx.pdfbin665418 -> 665420 bytes
5 files changed, 37 insertions, 14 deletions
diff --git a/macros/latex/contrib/siunitx/CHANGELOG.md b/macros/latex/contrib/siunitx/CHANGELOG.md
index c4aec21e34..7cdde2cf78 100644
--- a/macros/latex/contrib/siunitx/CHANGELOG.md
+++ b/macros/latex/contrib/siunitx/CHANGELOG.md
@@ -7,6 +7,12 @@ Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to
## [Unreleased]
+## [v3.1.8] - 2022-10-04
+
+### Fixed
+- Rounding to order of magnitude (see issue
+ [\#622](https://github.com/josephwright/siunitx/issues/622))
+
## [v3.1.7] - 2022-09-07
### Changed
@@ -1811,7 +1817,8 @@ Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to
### Added
- First public testing release (as `si`)
-[Unreleased]: https://github.com/josephwright/siunitx/compare/v3.1.7...HEAD
+[Unreleased]: https://github.com/josephwright/siunitx/compare/v3.1.8...HEAD
+[v3.1.8]: https://github.com/josephwright/siunitx/compare/v3.1.7...v3.1.8
[v3.1.7]: https://github.com/josephwright/siunitx/compare/v3.1.6...v3.1.7
[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
diff --git a/macros/latex/contrib/siunitx/siunitx-code.pdf b/macros/latex/contrib/siunitx/siunitx-code.pdf
index c9dcdaecda..cf6bc8c78c 100644
--- a/macros/latex/contrib/siunitx/siunitx-code.pdf
+++ b/macros/latex/contrib/siunitx/siunitx-code.pdf
Binary files differ
diff --git a/macros/latex/contrib/siunitx/siunitx-number.dtx b/macros/latex/contrib/siunitx/siunitx-number.dtx
index f80684ee9c..1d11f909f0 100644
--- a/macros/latex/contrib/siunitx/siunitx-number.dtx
+++ b/macros/latex/contrib/siunitx/siunitx-number.dtx
@@ -2757,7 +2757,9 @@
% \begin{macrocode}
\cs_new:Npn \@@_round_final_shift:nn #1#2
{
- \str_if_eq:VnTF \l_@@_round_mode_tl { places }
+ \bool_lazy_or:nnTF
+ { \str_if_eq_p:Vn \l_@@_round_mode_tl { figures } }
+ { \str_if_eq_p:Vn \l_@@_round_mode_tl { places } }
{
\use:c
{ @@_round_ \l_@@_exponent_mode_tl :nn }
@@ -2770,7 +2772,11 @@
{
\int_compare:nNnTF { \tl_count:n {#1} } = 4
{
- \@@_round_engineering:NNNNn #1 {#2}
+ \bool_lazy_and:nnTF
+ { \int_compare_p:nNn \l_@@_round_precision_int = 1 }
+ { \str_if_eq_p:Vn \l_@@_round_mode_tl { figures } }
+ { { 1 } { } }
+ { \@@_round_engineering:NNNNn #1 {#2} }
\@@_round_final_shift:Nw 3
}
{ {#1} {#2} }
@@ -2779,7 +2785,7 @@
{
{#1}
\exp_args:NV \@@_round_engineering:nnN
- { \l_@@_round_precision_int } { }
+ \l_@@_round_precision_int { }
#2#3#4#5 \q_recursion_tail \q_recursion_stop
}
\cs_new:Npn \@@_round_engineering:nnN #1#2#3
@@ -2793,11 +2799,17 @@
\cs_new:Npn \@@_round_input:nn #1#2 { {#1} {#2} }
\cs_new:Npn \@@_round_scientific:nn #1#2
{
- \@@_exponent_shift:nnf
- { 1 } {#1} { \@@_round_truncate_direct:n {#2} }
+ \bool_lazy_and:nnTF
+ { \int_compare_p:nNn \l_@@_round_precision_int = 1 }
+ { \str_if_eq_p:Vn \l_@@_round_mode_tl { figures } }
+ { { 1 } { } }
+ {
+ \@@_exponent_shift:nnf
+ { 1 } {#1} { \@@_round_truncate_direct:n {#2} }
+ }
\@@_round_final_shift:Nw 1
}
-\cs_new:Npn \@@_round_final_shift:Nw #1#2 \@@_round_places_end:nnn #3#4#5
+\cs_new:Npn \@@_round_final_shift:Nw #1#2 \@@_round_end:nnn #3#4#5
{
\exp_not:n { {#3} }
\@@_exponent_finalise:n { #4#5 + #1 }
@@ -2885,6 +2897,13 @@
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}[EXP]{\@@_round_end:nnn}
+% Used as a marker to allow adjustment when we pass a power of ten.
+% \begin{macrocode}
+\cs_new:Npn \@@_round_end:nnn #1#2#3 { \exp_not:n { {#1} {#2} {#3} } }
+% \end{macrocode}
+% \end{macro}
+%
% \begin{macro}[EXP]{\@@_round_figures:nnnnnnn, \@@_round_figures_aux:nnnnnnn}
% \begin{macro}[EXP]{\@@_round_figures_count:nnN}
% \begin{macro}[EXP]{\@@_round_figures_count:nnnN}
@@ -2913,7 +2932,7 @@
\exp_not:n { {#1} {#2} }
\@@_round_figures_count:nnN {#3} {#4} #3#4
\q_recursion_tail \q_recursion_stop
- \exp_not:n { { } {#6} {#7} }
+ \@@_round_end:nnn { } {#6} {#7}
}
{ { } { } { 0 } { } { } { } { 0 } }
}
@@ -2955,7 +2974,6 @@
% \end{macro}
%
% \begin{macro}[EXP]{\@@_round_places:nnnnnnn}
-% \begin{macro}[EXP]{\@@_round_places_end:nnn}
% \begin{macro}[EXP]{\@@_round_places_decimal:nn, \@@_round_places_integer:nn}
% \begin{macro}[EXP]{\@@_round_places_finalise:n}
% \begin{macro}[EXP]{\@@_round_places_finalise:nnnnnnn}
@@ -2977,12 +2995,11 @@
{ \@@_round_places_decimal:nn }
{ \@@_round_places_integer:nn }
{#3} {#4}
- \@@_round_places_end:nnn { } {#6} {#7}
+ \@@_round_end:nnn { } {#6} {#7}
}
}
{ \exp_not:n { {#1} {#2} {#3} {#4} {#5} {#6} {#7} } }
}
-\cs_new:Npn \@@_round_places_end:nnn #1#2#3 { \exp_not:n { {#1} {#2} {#3} } }
\cs_new:Npn \@@_round_places_decimal:nn #1#2
{
\int_compare:nNnTF
@@ -3056,7 +3073,6 @@
% \end{macro}
% \end{macro}
% \end{macro}
-% \end{macro}
%
% \begin{macro}[EXP]{\@@_round_uncertainty:nnnnnnn}
% \begin{macro}[EXP]{\@@_round_uncertainty_end:nn}
@@ -3249,7 +3265,7 @@
\use:c
{ @@_round_ \l_@@_exponent_mode_tl :nn }
{#2} {#3}
- \@@_round_places_end:nnn { { S } { 1 #1 } } {#4} {#5}
+ \@@_round_end:nnn { { S } { 1 #1 } } {#4} {#5}
}
% \end{macrocode}
% With the data available, adjust the output such that the uncertainty
diff --git a/macros/latex/contrib/siunitx/siunitx.dtx b/macros/latex/contrib/siunitx/siunitx.dtx
index 13a76da695..3e61bbb85c 100644
--- a/macros/latex/contrib/siunitx/siunitx.dtx
+++ b/macros/latex/contrib/siunitx/siunitx.dtx
@@ -121,7 +121,7 @@
%
% Identify the package and give the over all version information.
% \begin{macrocode}
-\ProvidesExplPackage {siunitx} {2022-09-07} {3.1.7}
+\ProvidesExplPackage {siunitx} {2022-10-04} {3.1.8}
{A comprehensive (SI) units package}
% \end{macrocode}
%
diff --git a/macros/latex/contrib/siunitx/siunitx.pdf b/macros/latex/contrib/siunitx/siunitx.pdf
index 4954530a97..15032f9957 100644
--- a/macros/latex/contrib/siunitx/siunitx.pdf
+++ b/macros/latex/contrib/siunitx/siunitx.pdf
Binary files differ