summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/circuitikz/pgfcircutils.tex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2021-09-06 21:14:19 +0000
committerKarl Berry <karl@freefriends.org>2021-09-06 21:14:19 +0000
commit6b55d156e26232afcb59f5e05cc912afa1fac942 (patch)
treef78c146770c654fdb41da39116858e44343f49e5 /Master/texmf-dist/tex/generic/circuitikz/pgfcircutils.tex
parent413605d769296bf1a73c81b2438907ffe1ba1102 (diff)
circuitikz (6sep21)
git-svn-id: svn://tug.org/texlive/trunk@60435 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic/circuitikz/pgfcircutils.tex')
-rw-r--r--Master/texmf-dist/tex/generic/circuitikz/pgfcircutils.tex20
1 files changed, 12 insertions, 8 deletions
diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcircutils.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcircutils.tex
index ae5fcf38def..e1d7314931e 100644
--- a/Master/texmf-dist/tex/generic/circuitikz/pgfcircutils.tex
+++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcircutils.tex
@@ -75,18 +75,22 @@
%% https://github.com/pgf-tikz/pgf/issues/861
%%
%% Thanks to "muzimuzhi Z" https://tex.stackexchange.com/a/547085/38080
+%% Thanks to Henri Menke for a faster approach https://github.com/circuitikz/circuitikz/commit/00966c45c42b464fab5429f89f2b7fb414e9b3f7#commitcomment-54592494
%%
\pgfkeysifdefined{/pgf/fpu/install only/.@cmd}{%
\pgfqkeys{/pgf}{use fpu reciprocal/.code={\pgfkeys{/pgf/fpu/install only={reciprocal}}}}%
}{%
- \pgfqkeys{/pgf}{use fpu reciprocal/.code={%
- \def\pgfmathreciprocal@##1{%
- \begingroup
- \pgfkeys{/pgf/fpu=true,/pgf/fpu/output format=fixed}%
- \pgfmathparse{1/##1}%
- \pgfmath@smuggleone\pgfmathresult
- \endgroup
- }}}%
+ \pgfkeysifdefined{/pgf/use fpu reciprocal/.@cmd}{% use stock one
+ }{
+ \pgfqkeys{/pgf}{use fpu reciprocal/.code={%
+ \def\pgfmathreciprocal@##1{%
+ \begingroup
+ \pgfmathfloatparsenumber{##1}%
+ \pgfmathfloatreciprocal@{\pgfmathresult}%
+ \pgfmathfloattofixed@{\pgfmathresult}%
+ \pgfmath@smuggleone\pgfmathresult
+ \endgroup
+ }}}}%
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%