A while ago I posted a message concerning my initial commit to the SVN
of a module for LaTeX3 for mathematics with real numbers. After a bit of
work (and some reading) I've decided that it is better to go with a
floating point approach rather than the initial fixed point arithmetic.
I've just committed the base arithmetic part of the module to the SVN.
The aim is to support two general areas, typesetting requirements and
processing scientific data. For the arithmetic operations, I've
therefore gone for an output precision of +-1 in the last (10th) place,
and an input range up to 9.999999999e99. As this is all being done in
TeX I hope that the balance makes sense to people.
The next thing to look at adding is trigonometric functions, as these
are needed for typesetting arbitrary rotations. I'm also hoping to
include exponents/logarithms when time allows. Obviously, I'd be happy
to hear about other functions that might be useful or indeed better
implementations for the ones that are provided.
The basic functions that I've added should hopefully work properly. I'm
also hopeful that now I've had time to 'polish' things a bit these
should be broadly stable. Please do try them out and report back any
issues. I'll certainly be doing this in siunitx, where I'm planning to
use the fpu to support some additional features.
An obvious approach to floating point work is to use LuaTeX, which can
do these things natively. Currently, expl3 works across all of the
modern engines, and so a LuaTeX-only solution isn't really applicable.
However, I will be looking at using Lua when available. In the fpu
context that will mean keeping the documented functions (\fp_add:Nn,
etc.) but swapping out the internals to use the much faster native
arithmetic Lua provides. I'll look at this area after the fpu covers
trig and log functions.