diff options
author | Norbert Preining <norbert@preining.info> | 2020-09-29 03:02:54 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2020-09-29 03:02:54 +0000 |
commit | d043a18e288914d3c46a1b10af1f30ce2df00588 (patch) | |
tree | 888d8c0677d7b328602f1ec5c09d324a325043ec /graphics/pgf/base/tex/pgflibraryfpu.code.tex | |
parent | 34310603e5253ef5742542e3f0123b341a70ee20 (diff) |
CTAN sync 202009290302
Diffstat (limited to 'graphics/pgf/base/tex/pgflibraryfpu.code.tex')
-rw-r--r-- | graphics/pgf/base/tex/pgflibraryfpu.code.tex | 47 |
1 files changed, 45 insertions, 2 deletions
diff --git a/graphics/pgf/base/tex/pgflibraryfpu.code.tex b/graphics/pgf/base/tex/pgflibraryfpu.code.tex index 270d9af8b5..c3bb9582c5 100644 --- a/graphics/pgf/base/tex/pgflibraryfpu.code.tex +++ b/graphics/pgf/base/tex/pgflibraryfpu.code.tex @@ -1,4 +1,4 @@ -% Copyright 2008/2009 by Christian Feuersaenger +% Copyright 2008/2019 by Christian Feuersaenger % % This file may be distributed and/or modified % @@ -88,6 +88,15 @@ \let\pgfmathfloat@relthresh=\pgfmathresult }, fpu/rel thresh=1e-4, + fpu/install only/.code={ + \pgfmath@warning{The key `/pgf/fpu/install only' is experimental and might % + change or disappear at any point!}% + \edef\pgf@list{#1}% + \pgfutil@for\pgf@temp:=\pgf@list\do{% + \expandafter\pgfmath@float@install@singlefunction\expandafter{% + \romannumeral-`0\expandafter\pgfutil@trimspaces\expandafter{\pgf@temp}}% + }% + }, }% \pgfmathfloatcreate{1}{1.0}{0}\let\pgfmathfloatscale=\pgfmathresult @@ -292,6 +301,40 @@ \pgfmathfloat@install\pgfmathscientific=\pgfmathfloatscientific% }% +\def\pgfmath@float@install@singlefunction#1{% + \ifcsname pgfmath@function@#1\endcsname\else + \pgfmath@error{The function `#1' does not exist}{}% + \fi + \pgfmath@toks={}% + \pgfmathloop + \ifnum\pgfmathcounter>\csname pgfmath@operation@#1@arity\endcsname\relax% + \else + \expandafter\pgfmath@addto@toks\expandafter{\pgfmath@char@hash}% + \expandafter\pgfmath@addto@toks\expandafter{\pgfmathcounter}% + \repeatpgfmathloop + \edef\pgfmath@head{\noexpand\def\expandafter\noexpand\csname pgfmath#1@\endcsname\the\pgfmath@toks}% + \pgfmath@toks={}% + \def\pgfmath@arguments{}% + \pgfmathloop + \ifnum\pgfmathcounter>\csname pgfmath@operation@#1@arity\endcsname\relax% + \else + \pgfmath@addto@toks{\pgfmathfloatparsenumber}% + \expandafter\expandafter\expandafter\pgfmath@addto@toks + \expandafter\expandafter\expandafter{\expandafter\expandafter\expandafter + {\expandafter\pgfmath@char@hash\pgfmathcounter}}% + \pgfmath@addto@toks{\let}% + \expandafter\pgfmath@addto@toks\expandafter{% + \csname pgfmath@argument@\pgfmathcounter\endcsname=\pgfmathresult}% + \expandafter\expandafter\expandafter\def\expandafter\expandafter\expandafter + \pgfmath@arguments\expandafter\expandafter\expandafter{\expandafter + \pgfmath@arguments\expandafter{\csname pgfmath@argument@\pgfmathcounter\endcsname}}% + \repeatpgfmathloop + \expandafter\pgfmath@addto@toks\expandafter{\csname pgfmathfloat#1@\expandafter\endcsname\pgfmath@arguments}% + \pgfmath@addto@toks{\pgfmathfloattofixed{\pgfmathresult}}% + \edef\pgfmath@body{{\the\pgfmath@toks}}% + \expandafter\pgfmath@head\pgfmath@body +} + \def\pgfmathfloat@iftrue{% \if Y\pgfmathfloatparse@output@choice \let\pgfmathfloat@@iftrue@v=\pgfmathfloatone @@ -864,7 +907,7 @@ \def\pgfmathfloattoextentedprecision#1{% \begingroup \pgfmathfloattoextentedprecision@a{#1}% - \pgfmathfloatcreate{\pgfmathfloat@a@S}{\pgfmathresult}{\pgfmathfloat@a@E}% + \pgfmathfloatcreate{\the\pgfmathfloat@a@S}{\pgfmathresult}{\the\pgfmathfloat@a@E}% \pgfmath@smuggleone\pgfmathresult \endgroup }% |