Received: from mout.gmx.net (mout.gmx.net [212.227.17.21]) by h1439878.stratoserver.net (8.14.4/8.14.4/Debian-2ubuntu2.1) with ESMTP id v2B0vOit007429 for ; Sat, 11 Mar 2017 01:57:25 +0100 Received: from relay2.uni-heidelberg.de ([129.206.119.212]) by mx-ha.gmx.net (mxgmx106 [212.227.17.5]) with ESMTPS (Nemesis) id 0LzqGN-1c8CQX2ynr-0153sX for ; Sat, 11 Mar 2017 01:57:18 +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 v2B0tTsR004825 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 11 Mar 2017 01:55:29 +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 v2AN14qC017007; Sat, 11 Mar 2017 01:55:29 +0100 Received: by LISTSERV.UNI-HEIDELBERG.DE (LISTSERV-TCP/IP release 16.0) with spool id 15720935 for LATEX-L@LISTSERV.UNI-HEIDELBERG.DE; Sat, 11 Mar 2017 01:55:29 +0100 Received: from relay2.uni-heidelberg.de (relay2.uni-heidelberg.de [129.206.119.212]) by listserv.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id v2B0tTJb023854 for ; Sat, 11 Mar 2017 01:55:29 +0100 Received: from mail-qk0-f172.google.com (mail-qk0-f172.google.com [209.85.220.172]) by relay2.uni-heidelberg.de (8.15.2/8.15.2) with ESMTPS id v2B0tMw3004744 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Sat, 11 Mar 2017 01:55:26 +0100 Received: by mail-qk0-f172.google.com with SMTP id 1so190610958qkl.3 for ; Fri, 10 Mar 2017 16:55:26 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=2hCOaUbSzWKgdW2gaRlJ9TYbi/7yVW/NQZfkFGWi9x0=; b=Zw7ZJLF9caHtC399jXHfUnZE4yi0CKpQ88+AU8c6DBrBCjpzzZm5OjkLdmXM/zC/M+ gGsNDRpLYSXby+iVb/ySKLDjXS/zQYJOka0URClQqlR/G+Ne07L91SKiGRQ7Bb+iXwBe x9sa8ZrC3fvFa31noJhEEr5CVlUqbZY4Htqy2L1cg2EbEJQrHUnTOlw9wM9TzS/8EOl3 PEx5OwMHBAh7J7hyULkDUOs6O3LnFcIVuuYldxtSnssfXPqKGYalQ1h1+0qTu1RgJHRa X6SiRuwIjzU8BXT8rePU/W5ZzG9mdO6sk227/jZ0ziNaMr0NYMu207Nz9ynIUiCl+yQ/ 3c+A== X-Gm-Message-State: AFeK/H3aQ/8VT2wlVwaiCZtPUsuqNydhgXFguOIrrDnP1w3VxgCj2QyI49trKJ4vjE0wgA== X-Received: by 10.55.69.68 with SMTP id s65mr21428287qka.43.1489193399470; Fri, 10 Mar 2017 16:49:59 -0800 (PST) Received: from [192.168.1.76] (c-69-141-211-196.hsd1.nj.comcast.net. [69.141.211.196]) by smtp.gmail.com with ESMTPSA id f126sm7455973qkc.47.2017.03.10.16.49.58 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 10 Mar 2017 16:49:58 -0800 (PST) References: <58C1DA5F.8010109@clear.net.nz> User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Message-ID: <1b5ec418-2f2d-d39d-af53-a8921d3e8176@gmail.com> Date: Fri, 10 Mar 2017 19:49:58 -0500 Reply-To: Mailing list for the LaTeX3 project Sender: Mailing list for the LaTeX3 project From: Bruno Le Floch Subject: Re: Two more (simple) functions for l3fp To: LATEX-L@LISTSERV.UNI-HEIDELBERG.DE In-Reply-To: <58C1DA5F.8010109@clear.net.nz> Precedence: list List-Help: , List-Unsubscribe: List-Subscribe: List-Owner: List-Archive: X-MIME-Autoconverted: from 8bit to quoted-printable by relay2.uni-heidelberg.de id v2B0tTsR004825 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:gbqFwZveYuk=:dNqRTklwx1krnPnsVgxdZ9LgL4 atIwVeHhakiCGYsbTBuuMgJODdm4qx5ZU9kEb/vVrpsz/1hXcHwSBDLP5fhMSHxjOW/FxX6Ze acQCLHjwZ2csqGI4Ot/A32wr8Dc0/Gf/xQRb8fjeHOxTKF57rjrTqIS7ZRx4sb0OxIlyQNoQQ Puf6YP1hhg1MJc40FQmTbiyF7QKHQLwmc3gX0QldC0i1rg1nDyS6ZrqxUXT8R9zhtd1xMjlfU FylKd9ZyJEvSoiEdKlbPPUaynstHDsfbsEgibhFH7FUao8BIhOw5LJNS7gzgIli2Av1JZqJNN JvlhxfFUfM7909VYHvJvEbmT5GoV0ETf+GiZUaqGfxoTUQUWl4+3prj2KKg2/kj7WnSHeIY2d J6K+z9LnWBRExkLu80C3/JU94DPgvZWwZrqNZqwmcZ1vj15EdB2fmEG9RNfe/xUD5S9/2hab0 lZucfs4SZ2Jg++JsHzLjnER+SOFVbrA0frtm5M6yYS99oCHa3LTZ25VKRguQXLZaR+Hic5FiH TDKVUlHLgoRrnSvDaDGVoRwqZ+in4kuiLnJupe07pYUfyz6n2Aio7MlMTB1SJ2RbnYwlj1+Ot VB2uPDA1u9tzgc3nEJ9qlSDKg1IZG4Ou+TMcMXtZdaunYQttiacVSlgJuvYM5srJdcZ2w8xZD nC5/32o3eeoTswRSUqub1IAjq2N19KUQAoJgEeh7ZedPfDRynB3NXjzm4ye2Kh8k8c8TSA4Lg 1pQ8cgQ3wubdfuGvzsj1WhBEfIIcI2lzj3/gknkIq9gD4gAFje6n3sBKCsVN1gRapx9zkyBJ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NGeeo/azwAgw0GwqeXNrl4jE4a38CkhLy1331yaNMydIl yzlHY8UV56jrfYfFdIrz/oDbEJxgIc3kk9/vasl+TBSxgt2xFXJYV0Ase71cbClqpmwuX2ujU LxSJDPO/xVHnOrbs2lbXsVjaKx5v+utDyLvGolpYiof1w9L2VRwe9oxJHEZrw2TIKhZhyznP2 TKdRaEvNbMb1no/7HbkKGEZGl9mvMc/+o8lK+uCEMr+Y1iEO/+AHhOYJPAzjrNmu+DECiabwd 66fntHYEL8oz4VdEodKPdqqpjmJycvDjm+bl1q6jOV5jLQG48g9AzRw8Nyg7RvHbNU6jFsfZR 0XdkEyaKSU2fxqVvK5i+1ciUqQg4Lnnfq5+2fHVftJyRcKcah7wtgwZMVHUGpN7VgNjd/9B+3 BdJB+964iODixbGt/nu4F2x47Gp5cFd5yQb3B6SHRX5Ich78aUJmJWAZn6FVtJFeivLkpj1Ic 3iL7U5U8iUp1NpzJu2o0W+8C+ka/rkOEvtCN1RLYCXZ X-Scanned-By: MIMEDefang 2.71 on 85.214.41.38 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by h1439878.stratoserver.net id v2B0vOit007429 Status: R X-Status: X-Keywords: X-UID: 7950 On 03/09/2017 05:42 PM, Andrew Parsloe wrote: > Two functions which I think could be beneficially added to l3fp without > straining its role as a kernel module (in the way that, say, the gamma > function would) are the signature function (sgn) and a unit step > function (Heaviside? -- the difficulty is what value to assign at 0). > Given the numerical values assigned to true and false in l3fp, it is > easy to mimic these with simple inequalities (e.g. (#1 > 0) - (#1 < 0) > for sgn) but perhaps the functions should be there in the first place? > > I found myself wanting these when considering a table of fp values where > it made sense to blank cells containing negative values which "got in > the way". The code creating the table contained the option of blanking > zero-value cells, so I multiplied the tabulated formula by 1 - (#1 < 0). > > Andrew > > --- > This email has been checked for viruses by Avast antivirus software. > https://www.avast.com/antivirus Will copied your message to https://github.com/latex3/latex3/issues/346 and replied there that > sign() or sgn() definitely makes sense to me, but I’m not sure about > step() / heaviside() / whatever. Can you give another example for the > use case there? I'm adding sign(). I don't think heaviside is needed: (#1) > 0 ? (#1) : 0 seems to do what you want pretty nicely. What do you think? Concerning Gamma, the main reason I haven't implemented it yet is that it requires determining some magic constants that were only given to me for a lower precision than what I need (10 digits instead of 16). Bruno