LATEX-L Archives

Mailing list for the LaTeX3 project


Options: Use Forum View

Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Bruno Le Floch <[log in to unmask]>
Reply To:
Mailing list for the LaTeX3 project <[log in to unmask]>
Sun, 1 Jun 2014 13:40:38 -0400
text/plain (23 lines)
> I had the experience recently of checking a complicated trigonometric
> expression derived, after an embarrassingly long labour, from another
> complicated trigonometric expression. Had I made a mistake in the
> working? I evaluated the expressions using l3fp. One, for a number of
> different parameter values gave 0, the other for the same parameter
> values gave -0. I concluded, ruefully, that the derivation was correct.

Note that \fp_compare:nTF { 0 = -0 } { true } { false } gives true, so
you could just let l3fp compare the numbers.  I have to say I'm
surprised by that use of l3fp: I'd definitely use a general purpose
programming language for that (e.g., python).  Happy l3fp helps.

> To someone, like me, not versed in numerical analysis, the occurrence of
> signed zero was a surprise. The 0+x trick is good to know and perhaps
> worth mentioning in the documentation.

I'm not keen on mentioning it in the documentation, as it is a trick
indeed.  Instead, I've moved "customized formatting of floating
points" (e.g. with a printf-like syntax) up in my todo list.  I have
some ideas there.