LATEX-L Archives

Mailing list for the LaTeX3 project

LATEX-L@LISTSERV.UNI-HEIDELBERG.DE

Options: Use Classic View

Use Monospaced Font
Show Text Part by Default
Condense Mail Headers

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

Print Reply
Sender: Mailing list for the LaTeX3 project <[log in to unmask]>
Date: Sun, 1 Jun 2014 13:40:38 -0400
Reply-To: Mailing list for the LaTeX3 project <[log in to unmask]>
MIME-Version: 1.0
Message-ID: <[log in to unmask]>
In-Reply-To: <[log in to unmask]>
Content-Type: text/plain; charset=UTF-8
From: Bruno Le Floch <[log in to unmask]>
Parts/Attachments: 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.

Bruno

ATOM RSS1 RSS2