Received: from mout.gmx.net (mout.gmx.net [212.227.17.20]) by h1439878.stratoserver.net (8.14.2/8.14.2/Debian-2build1) with ESMTP id s51HhxWS021015 for ; Sun, 1 Jun 2014 19:44:00 +0200 Received: from relay.uni-heidelberg.de ([129.206.100.212]) by mx-ha.gmx.net (mxgmx102) with ESMTPS (Nemesis) id 0Lar1o-1WOfg13MtM-00kOk8 for ; Sun, 01 Jun 2014 19:43:54 +0200 Received: from listserv.uni-heidelberg.de (listserv.uni-heidelberg.de [129.206.100.94]) by relay.uni-heidelberg.de (8.14.1/8.14.1) with ESMTP id s51HewYc002986 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 1 Jun 2014 19:40:58 +0200 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 s4VM13PL004861; Sun, 1 Jun 2014 19:40:58 +0200 Received: by LISTSERV.UNI-HEIDELBERG.DE (LISTSERV-TCP/IP release 16.0) with spool id 11053350 for LATEX-L@LISTSERV.UNI-HEIDELBERG.DE; Sun, 1 Jun 2014 19:40:58 +0200 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 s51HewcR001895 for ; Sun, 1 Jun 2014 19:40:58 +0200 Received: from mail-qa0-f50.google.com (mail-qa0-f50.google.com [209.85.216.50]) by relay.uni-heidelberg.de (8.14.1/8.14.1) with ESMTP id s51Hec6V002883 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=FAIL) for ; Sun, 1 Jun 2014 19:40:41 +0200 Received: by mail-qa0-f50.google.com with SMTP id j15so1471544qaq.23 for ; Sun, 01 Jun 2014 10:40:38 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.224.114.81 with SMTP id d17mr42247955qaq.33.1401644438431; Sun, 01 Jun 2014 10:40:38 -0700 (PDT) Received: by 10.96.212.1 with HTTP; Sun, 1 Jun 2014 10:40:38 -0700 (PDT) References: <5382FD21.6040600@clear.net.nz> <53865805.7030602@clear.net.nz> Content-Type: text/plain; charset=UTF-8 Message-ID: Date: Sun, 1 Jun 2014 13:40:38 -0400 Reply-To: Mailing list for the LaTeX3 project Sender: Mailing list for the LaTeX3 project From: Bruno Le Floch Subject: Re: l3fp and sin(pi), cos(pi/2) To: LATEX-L@LISTSERV.UNI-HEIDELBERG.DE In-Reply-To: <53865805.7030602@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:AZwWZGpMAgg=:a6iD/FKpdXbKMiNbZY9Xac0ArF 9omMmIiSZvPBZJc26Q+WEe5xw1yJtpvb2Er2NGmSXGyk/ERQomIzbQMZgJzT1+hTWJk0FnJHX uQQQUc9xjiAAdByNNHX+T5lLoNEgBB1r+mVWk9VBdq11YCtMuAz5JsGLJi1GHNMaLfkAsdrxu Nm0VmBRJL4DBhWa1WQJhYCtI/RcwvpPKgRhDnoQ71boMkTTiKBcSaKCmFHVax4Fb7oUa4eVYk ixhiMEhLjtPvL4Y8q9PV1eP5aKfFOvqVMfZop1A6dAxIIedoXFpkpDg25OkAjuDxeMdXRO3Vc 3ftKM18mQalOeIZhSrhdpsEVPIt5kQds/IAIAlQCqGuQHidG/RhfP4B7GaUAAPjloO6bR16/S YlwbPLELda6OK20QdFKpGLqUxQO2OUKlZg2cDIIJ5jmwSZ/m89hc/LdKmPERiTlj4lQJc+CcZ FshT9LyfX0YU+iVt+KGkQ97JRA4NprHAUDYp36NYhpKrrlcVwOCKGZI5fQe+Dt1WUaG3vXme7 Gs3KOzK+KOX8oFcREc5V8Hvv+7DEZHAPDp9tki/OV0dpm1vh/HapsLs0j8YBu+/Zl//j+C8/6 P/QUrrt+gkaIluZBSCivI8BJiPFFs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ience 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