pgfmanual.pdf, VII Utilities, Repeating Things: The Foreach Statement, says:
\foreach \x in {0,0.1,...,0.5} {\x, }yields 0, 0.1, 0.20001, 0.30002, 0.40002,
and warns about rounding-errors causing this.
Is doing things in terms of expl3's \fp_step_inline:nnnn generally safer?
(If I do
\documentclass{article}
\begin{document}
\ExplSyntaxOn\fp_step_inline:nnnn {0}{0.1}{0.5}{#1,~}\ExplSyntaxOff
\end{document}
, then I get: "0, 0.1, 0.2, 0.3, 0.4, 0.5, " .)
==,<=etc.) with a floating point quantity was an error always... whatever the precision. – Rmano Aug 18 '23 at 17:38-Wfloat-equal:-) – David Carlisle Aug 18 '23 at 18:14{0, ..., 5}and divide that by 10. I'm sure some of the related Qs cover this. TikZ also has thegridpath operation. There are many ways to draw a grid. Some better or worse depending on the situation. – Qrrbrbirlbel Aug 18 '23 at 18:41gisn't so far fromron a keyboard :-) – David Carlisle Sep 02 '23 at 08:27