Received: from mout.gmx.net (mout.gmx.net [212.227.15.18]) by h1439878.stratoserver.net (8.14.4/8.14.4/Debian-2ubuntu2.1) with ESMTP id uB2EnnMo007169 for ; Fri, 2 Dec 2016 15:49:50 +0100 Received: from relay2.uni-heidelberg.de ([129.206.119.212]) by mx-ha.gmx.net (mxgmx004 [212.227.15.9]) with ESMTPS (Nemesis) id 0MI86g-1cGfRR1oYI-003rmH for ; Fri, 02 Dec 2016 15:49:44 +0100 Received: from listserv.uni-heidelberg.de (listserv.uni-heidelberg.de [129.206.100.94]) by relay2.uni-heidelberg.de (8.15.2/8.15.2) with ESMTPS id uB2Em6tv003885 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 2 Dec 2016 15:48:06 +0100 Received: from listserv.uni-heidelberg.de (listserv.uni-heidelberg.de [127.0.0.1]) by listserv.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id uB2D0Ssq008349; Fri, 2 Dec 2016 15:48:06 +0100 Received: by LISTSERV.UNI-HEIDELBERG.DE (LISTSERV-TCP/IP release 16.0) with spool id 14934228 for LATEX-L@LISTSERV.UNI-HEIDELBERG.DE; Fri, 2 Dec 2016 15:48:06 +0100 Received: from relay.uni-heidelberg.de (relay.uni-heidelberg.de [129.206.100.212]) by listserv.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id uB2Em5V7019767 for ; Fri, 2 Dec 2016 15:48:05 +0100 Received: from mail-qt0-f182.google.com (mail-qt0-f182.google.com [209.85.216.182]) by relay.uni-heidelberg.de (8.15.2/8.15.2) with ESMTPS id uB2Elx0m023060 (version=TLSv1.2 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Fri, 2 Dec 2016 15:48:02 +0100 Received: by mail-qt0-f182.google.com with SMTP id p16so252935357qta.0 for ; Fri, 02 Dec 2016 06:48:02 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=oRcC8cRLWTImrZBBFNuYeOzhkj4Yf0/pNwDObP8uMX0=; b=D4OKzeTtxnZqyGFt7F3HBWnfP+gi3hjTA5X45KqGgh/UnRKw5Sq6H0vTjp80OmEr9A EqNdU4qlK7IRk+b09cl5EbRf10SKcPDKz6sut2/CYGguv9AZNei6J5T72XA6loDUZtuh CLtMH1iQ4o0Lh2xZC/10+EdApbX9vs35v7Bk6gYp4wuHokGTjRiqcLSUCjKeYZ2I2h9W 7Oxkvchzmn1TltO8+b6q3PZWj9V6arIbTeJgUSOm8WQHGbsdEEAjoGfckxhEjvLbwI2j TA+KzDNuvT1RP2FXWMQMBbf3rq7mdMc1y9xCdK7RqJ+IH18VpoSdm6uwLhSDh0Psm3zW 4syw== X-Gm-Message-State: AKaTC03SdStiGEKYMBznMDVBIYGrZfDydoz7PneW9S9XPIwC7UDI7Qi+x8i3/VL7+T6wlg== X-Received: by 10.237.37.148 with SMTP id x20mr39244112qtc.192.1480690079130; Fri, 02 Dec 2016 06:47:59 -0800 (PST) Received: from [10.8.14.146] (nat-oitwireless-outside-vapornet3-h-23.Princeton.EDU. [140.180.247.35]) by smtp.gmail.com with ESMTPSA id h47sm2714017qtc.27.2016.12.02.06.47.58 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 02 Dec 2016 06:47:58 -0800 (PST) References: <584139D8.1000208@clear.net.nz> User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Message-ID: Date: Fri, 2 Dec 2016 09:47:58 -0500 Reply-To: Mailing list for the LaTeX3 project Sender: Mailing list for the LaTeX3 project From: Bruno Le Floch Subject: Re: Rounding quirk in l3fp To: LATEX-L@LISTSERV.UNI-HEIDELBERG.DE In-Reply-To: <584139D8.1000208@clear.net.nz> Precedence: list List-Help: , List-Unsubscribe: List-Subscribe: List-Owner: List-Archive: Envelope-To: X-GMX-Antispam: 0 (Mail was not recognized as spam); Detail=V3; X-GMX-Antivirus: 0 (no virus found) X-UI-Filterresults: notjunk:1;V01:K0:i1dJZq5gBAM=:UhyRWBL8b2m4H1OyZ7iPSWtQV5 V+JkINIw1HM7f3Odo2MZK8iIxEwW5Dom0TBXvjx/J0CTZuqdcrs70xvijDHZToUgFIYf4dYxb qH3+NL6rwgAhHEkE13tKgzEySkjr4M1FuxENr10NzK3js0Ie9KcK68O8I+pBZkzagH4PF2eZM X3K4a+nxcob+5Fe8/LHqL6RlvgZtuReE+2ubK5YhQvRvrvhL//oDChSv+pNatdGhbGWzdXcjr vF9cazNVIJOjZIAL2JkwxjqBkK01GrJ0NpMChMkrcGdZJBQeDTtkfGMDpZ1370yc4PHmJPuzv ADTB0H623r4P4ilIUbt4zJvsHPDYL3D+LdHpjEOZ5+qXWmMppDAdBwMsKi4IjEWVGyEc8+5LO kMcNF6YDg9T4im3Hc2DB/Dv3+aAAXFruU1/QBbLtIoEbm05cS3LCK88W/Cb9pz4VNS8Nnz6u4 FhHzutng/iqslwh3xf1QlFrNLh/mThfkESfnaA0oSkq90VxVzOb4nn9C8nf8ImRWiaIQW27V6 DCnk4bei7IoKkjGNjuo3JGX6367Z757cpmN5JuXkipvC1xzqRM+il3IWDe63aytyzjAQyhMxW yv3JdTh4TA6h+nrKYTVj6oInElITE88bWshfm5Cqdk847xPx6xOTaAMmldNWWuTDwuIhLGjzo 9elNwnVB1cOzNb+tBZABrMuC0nxr2fuQykyKKkJ4j5/w65693FqHNkFqpfoxGby+H+953w8eq syOYpXIVVu/OynS63+xC0/GTv7woAdJ8MXP4AyMkr6LHSVfSO9KZAjxil1/+r7RQIqBGbJGx+ UDTORTF8tUfnpjO6pv09CyAMP+k5GfKx/wB+DOHHMnX6lXpupOJ8sEOiQTx4gLfb59DKaK4F0 C/MXHIAqm42pHjkRbpwiF8eEasexOEJOp0SY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l3QRIU ztwLUh7pvyPHw0IrvYtHl4v8O03GSUmKoWDt1n2quYl3pljOl4xLYTYca15oT/hYwRSf6jEdY cT9rW3SzVr5yYeqGx007xE551TS8+o2Pm9dfcLUjFXzd18UTSQXU5um5IrqvxnNuA6mNW2kV6 tHcFk2Iek1KOkX6oYE65QGjrIMc6lUFBqOk9l/I08ATk5J9vv0stDsa6AkUqDgb8ad2x5Fk6q TvBQlh8F3M2oNSHsFbHZZIEGJqpWuufh6A8+nUtNZwbLZOgUEIHKkg6Fv+DHAn+QYe0APF9Uv T/EqhRaexTdsFuSDtyTLbGSXAe8R+2QlkAttSxtHMPnEKBY2VLAgsfUUDp/xEQkP44Y0IdSy2 YOU13IC4FfflayIVZ48Ai/9SF0qMkVwSMKFn9VmZpdx X-Scanned-By: MIMEDefang 2.71 on 85.214.41.38 Status: R X-Status: X-Keywords: X-UID: 7934 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 arguments. I'll fix it some time this month. Best regards, Bruno