diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/l3experimental/l3str/l3str-format.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/l3experimental/l3str/l3str-format.dtx | 59 |
1 files changed, 27 insertions, 32 deletions
diff --git a/Master/texmf-dist/source/latex/l3experimental/l3str/l3str-format.dtx b/Master/texmf-dist/source/latex/l3experimental/l3str/l3str-format.dtx index 89e650c53ca..189ea896cc0 100644 --- a/Master/texmf-dist/source/latex/l3experimental/l3str/l3str-format.dtx +++ b/Master/texmf-dist/source/latex/l3experimental/l3str/l3str-format.dtx @@ -35,7 +35,7 @@ % %<*driver|package> \RequirePackage{expl3} -\GetIdInfo$Id: l3str-format.dtx 6009 2015-09-18 08:09:21Z joseph $ +\GetIdInfo$Id: l3str-format.dtx 6439 2016-03-23 12:03:41Z joseph $ {L3 Experimental string formatting} %</driver|package> %<*driver> @@ -825,42 +825,37 @@ % case, round to |#4+1| significant figures (one before the decimal % separator, |#4| after). % \begin{macrocode} -\group_begin: -\char_set_catcode_other:N E -\tl_to_lowercase:n +\cs_new:Npn \@@_fp_e:wn \s__fp \__fp_chk:w #1#2#3 ; #4 { - \group_end: - \cs_new:Npn \@@_fp_e:wn \s__fp \__fp_chk:w #1#2#3 ; #4 + \int_case:nnF {#1} { - \int_case:nnF {#1} - { - {0} { \use:nf { 0 . } { \prg_replicate:nn {#4} { 0 } } e 0 } - {2} { inf } - {3} { nan } - } - { - \exp_last_unbraced:Nf \@@_fp_e_aux:wn - \@@_fp_round:wn \s__fp \__fp_chk:w #1#2#3 ; { #4 + 1 } - {#4} - } + { 0 } { \use:nf { 0 . } { \prg_replicate:nn {#4} { 0 } } e 0 } + { 2 } { inf } + { 3 } { nan } } - \cs_new:Npn \@@_fp_e_aux:wn - \s__fp \__fp_chk:w #1#2 #3 #4#5#6#7 ; #8 { - \@@_put:fw { \int_eval:n { #3 - 1 } } - \@@_put:nw { e } - \int_compare:nNnTF {#8} > \c_sixteen - { - \@@_put:fw { \prg_replicate:nn { #8 - \c_fifteen } {0} } - \@@_put:fw { \use_none:n #4#5#6#7 } - } - { - \@@_put:fw - { \str_range:nnn { #4#5#6#7 0 } { 2 } { #8 + 1 } } - } - \@@_put:fw { \use_i:nnnn #4 . } - \use_none:n \s__stop + \exp_last_unbraced:Nf \@@_fp_e_aux:wn + \@@_fp_round:wn \s__fp \__fp_chk:w #1#2#3 ; { #4 + 1 } + {#4} + } + } +\cs_new:Npn \@@_fp_e_aux:wn + \s__fp \__fp_chk:w #1#2 #3 #4#5#6#7 ; #8 + { + \@@_put:fw { \int_eval:n { #3 - 1 } } + \@@_put:nw { e } + \int_compare:nNnTF {#8} > \c_sixteen + { + \@@_put:fw { \prg_replicate:nn { #8 - \c_fifteen } {0} } + \@@_put:fw { \use_none:n #4#5#6#7 } + } + { + \@@_put:fw + { \str_range:nnn { #4#5#6#7 0 } { 2 } { #8 + 1 } } } + \@@_put:fw { \use_i:nnnn #4 . } + \use_none:n \s__stop + } } % \end{macrocode} % \end{macro} |