summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-fpu.tex
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-fpu.tex')
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-fpu.tex29
1 files changed, 15 insertions, 14 deletions
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-fpu.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-fpu.tex
index bdc58135ef0..2a46a0a2e5f 100644
--- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-fpu.tex
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-fpu.tex
@@ -21,8 +21,8 @@
\begin{pgflibrary}{fpu}
The floating point unit (fpu) allows the full data range of scientific
computing for use in \pgfname. Its core is the \pgfname\ math routines for
- mantissa operations, leading to a reasonable trade--of between speed and
- accuracy. It does not require any third--party packages or external
+ mantissa operations, leading to a reasonable trade-of between speed and
+ accuracy. It does not require any third-party packages or external
programs.
\end{pgflibrary}
@@ -32,7 +32,7 @@
The fpu provides a replacement set of math commands which can be installed in
isolated placed to achieve large data ranges at reasonable accuracy. It
provides at least%
- \footnote{To be more precise, the FPU's exponent is currently a 32 bit
+ \footnote{To be more precise, the FPU's exponent is currently a 32-bit
integer. That means it supports a significantly larger data range than an
IEEE double precision number -- but if a future \TeX\ version may provide
low-level access to doubles, this may change.}%
@@ -56,7 +56,7 @@ by \pgfname.
will be replaced with |\pgfmathfloatadd| and so on. Furthermore, any number
will be parsed with |\pgfmathfloatparsenumber|.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usepgflibrary{fpu}}]
\pgfkeys{/pgf/fpu}
\pgfmathparse{1+1}\pgfmathresult
\end{codeexample}
@@ -73,7 +73,8 @@ by \pgfname.
such methods as well.
%--------------------------------------------------
-% \begin{codeexample}[]
+% TODOsp: codeexamples: Why is this example commented?
+% \begin{codeexample}[preamble={\usepgflibrary{fpu}}]
% \begin{tikzpicture}
% \fill[red,fpu,/pgf/fpu/scale results=1e-10] (*1.234e10,*1e10) -- (*2e10,*2e10);
% \end{tikzpicture}
@@ -86,7 +87,7 @@ by \pgfname.
It does not hurt to call |fpu=true| or |fpu=false| multiple times.
- Please note that if the |fixed point arithmetics| library of \pgfname\ will
+ Please note that if the |fixedpointarithmetic| library of \pgfname\ will
be activated after the FPU, the FPU will be deactivated automatically.
\end{key}
@@ -97,7 +98,7 @@ by \pgfname.
The predefined choice |float| uses the low-level format used by the FPU.
This is useful for further processing inside of any library.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usepgflibrary{fpu}}]
\pgfkeys{/pgf/fpu,/pgf/fpu/output format=float}
\pgfmathparse{exp(50)*42}\pgfmathresult
\end{codeexample}
@@ -106,7 +107,7 @@ by \pgfname.
\meta{mantissa}|e|\meta{exponent}. It provides almost no computational
overhead.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usepgflibrary{fpu}}]
\pgfkeys{/pgf/fpu,/pgf/fpu/output format=sci}
\pgfmathparse{4.22e-8^-2}\pgfmathresult
\end{codeexample}
@@ -115,7 +116,7 @@ by \pgfname.
highest compatibility with the \pgfname\ engine. It is activated
automatically in case the FPU scales results.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usepgflibrary{fpu}}]
\pgfkeys{/pgf/fpu,/pgf/fpu/output format=fixed}
\pgfmathparse{sqrt(1e-12)}\pgfmathresult
\end{codeexample}
@@ -151,8 +152,8 @@ by \pgfname.
There are other ways to increase the data range and/or the precision of
\pgfname's math parser. One of them is the |fp| package, preferable combined
-with \pgfname's |fixed point arithmetic| library. The differences between the
-FPU and |fp| are:
+with \pgfname's |fixedpointarithmetic| library. The differences between the FPU
+and |fp| are:
%
\begin{itemize}
\item The FPU supports at least the complete IEEE double precision number
@@ -357,7 +358,7 @@ Flags: \F; Mantissa \M; Exponent \E
\item[5] for $-\infty$.
\end{description}
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{fpu}}]
\pgfmathfloatparsenumber{42}
\pgfmathfloatifflags{\pgfmathresult}{0}{It's zero!}{It's not zero!}
\pgfmathfloatifflags{\pgfmathresult}{1}{It's positive!}{It's not positive!}
@@ -650,12 +651,12 @@ been activated -- it is sufficient to load the library.
$\meta{x} \le 0$), |\pgfmathresult| will be \emph{empty}, no error message
will be generated.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{fpu}}]
\pgfmathlog{1.452e-7}
\pgfmathresult
\end{codeexample}
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{fpu}}]
\pgfmathlog{6.426e+8}
\pgfmathresult
\end{codeexample}