LATEX-L Archives

Mailing list for the LaTeX3 project


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: Fri, 2 Dec 2016 09:47:58 -0500
Reply-To: Mailing list for the LaTeX3 project <[log in to unmask]>
Message-ID: <[log in to unmask]>
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
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 (31 lines)
On 12/02/2016 04:07 AM, Andrew Parsloe wrote:
> I stumbled on the following quirk recently:
> \tl_clear:N \l_tmpa_tl
> \fp_eval:n { round( \l_tmpa_tl, 4) }
> gives 4 as the answer (or whatever the rounding value is). Usually, in
> the situation where this arose, \l_tmpa_tl is a string of digits
> possibly including a decimal point. In this instance it was empty. Okay,
> I can check for that, but I wonder if l3fp should do so, and either give
> an error, as
> \fp_set:Nn \l_tmpa_fp { \l_tmpa_tl }
> does when the token list is empty, or give a conventional 0 as answer?
> Andrew

Thanks, this is a bug.  A better behavior would be to throw an error and
give nan.

This is due to my recent commit adding random number support: to allow
for rand() I did the easiest thing which was to allow and ignore empty

I'll fix it some time this month.

Best regards,