Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

\pgfmathfloatparse is a copy of \pgfmathparse when /pgf/fpu=false #727

Closed
schtandard opened this issue Aug 6, 2019 · 2 comments
Closed

Comments

@schtandard
Copy link
Contributor

schtandard commented Aug 6, 2019

When the fpu library is not "installed", i.e. \pgfmathparse and friends have their normal behavior, \pgfmathfloatparse is a copy of \pgfmathparse, i.e. it does not parse floating point numbers.

\documentclass{article}

\usepackage{tikz}
\usetikzlibrary{fpu}

\begin{document}

\pgfmathparse{1.234e-56}\pgfmathresult

\pgfmathfloatparse{1.234e-56}\pgfmathresult

\pgfkeys{/pgf/fpu}

\pgfmathparse{1.234e-56}\pgfmathresult

\pgfmathfloatparse{1.234e-56}\pgfmathresult

\end{document}

outputs

0.0
0.0
1Y1.234e-56]
1Y1.234e-56]

but should output

0.0
1Y1.234e-56]
1Y1.234e-56]
1Y1.234e-56]

@hmenke
Copy link
Member

hmenke commented Aug 6, 2019

Well, it does parse floating point numbers, it just doesn't output them as FPU floats. I'm not sure what the correct behaviour should be here, because FPU floats are pretty much useless when the fpu is not enabled.

@schtandard
Copy link
Contributor Author

schtandard commented Aug 7, 2019

Does it?

\pgfmathfloatparse{1.234e-56 * 5.25e57}\pgfmathresult

does not work with fpu disabled either, so it can't just be the output formatting.

I don't agree that the fpu functions are useless separately. They can be used to parse floating point numbers without disturbing the usual drawing functions (when the floating point numbers are not to be used for drawing directly). In the current state, one has to locally activate fpu for each calculation.

I thought that this was the whole point of having the float versions of all the math macros. If \pgfmathparse and pgfmathfloatparse do the same thing regardless of if fpu is loaded or not, what's the point of having both names?

@hmenke hmenke added this to the 3.1.5 milestone Nov 3, 2019
hmenke added a commit to hmenke/pgf that referenced this issue Nov 5, 2019
@hmenke hmenke closed this as completed Nov 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants