6

I use fp a lot. What is the point of modifying all the code? I prefer the syntax of xfp but is this a sufficient argument? You are going to say that \fpeval is expandable but what is the example that can tilt the balance in favour of xfp ? Maybe a Tag xfp would be useful ?

Update

After reading the comments and reading the linked documents, I specify what I am looking for :

  1. Speed : It's not a really argument for me, when we use TeX for calculations and geometric drawings I think we can wait a bit for a result.
  2. Functionality it's important
  3. Technical considerations (particularly expandability)

Do you have examples (with fp and xfp) that show that one is more functional than the other, or that xfp is expandable is a major asset or that not being expandable is sometimes useful?

Alain Matthes
  • 95,075
  • 1
    I think one nontrivial example in which expandability is an advantage is when you use it in pstricks coordinates, which do not get parsed. Otherwise you'd have to define tons of macros for each component that is to be parsed. (Let's not discuss why one would still want to use pstricks. ;-) There are many additional examples where \numexpr does not suffice because it basically only works with integers. Of course, if you use TikZ the advantage is much less pronounced since you can just define a function that uses fp and gets parsed wherever needed, as you know very well. –  Jan 03 '20 at 23:30
  • 2
    https://www.texdev.net/2018/12/09/floating-point-calculations-in-latex and https://tex.stackexchange.com/questions/463554/known-benchmarks-for-floating-point-calculations – Ulrike Fischer Jan 03 '20 at 23:36
  • 1
    another advantage, if you are using latex-dev (or latex from 2020-02-02) is that expl3 (so all the code behind xfp) is loaded in the format, – David Carlisle Jan 03 '20 at 23:38
  • 1
    @DavidCarlisle I would love to see your time machine. :) – frougon Jan 03 '20 at 23:46
  • @frougon you can see it now, type latex-dev '\stop' into a terminal:-) – David Carlisle Jan 03 '20 at 23:52
  • 1
    @UlrikeFischer I do not see how these comparisons really answer the question. It is good to have them, yes, but does this answer the question? –  Jan 04 '20 at 00:19
  • 3
    @Schrödinger's cat that's why I "only" commented. (But the fact that fp is slow and that you can't use it where a number is expected is quite important for me). – Ulrike Fischer Jan 04 '20 at 07:49
  • 1
    @frougon no timemachine involved, read https://www.latex-project.org/news/2019/09/01/LaTeX-dev-format/ to learn about -dev formats – Frank Mittelbach Jan 04 '20 at 10:17
  • @FrankMittelbach I just try lualatex-dev to compile 170 pages of my new documentation with 200 pictures, it's fine !! – Alain Matthes Jan 04 '20 at 10:59
  • @AlainMatthes good to hear, please continue doing these kind of tests and watch the news feed on the website, there will be another -dev version in a couple of days – Frank Mittelbach Jan 04 '20 at 11:31

0 Answers0