From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Tomas Volf <~@wolfsden.cz> Newsgroups: gmane.lisp.guile.bugs Subject: bug#74031: [PATCH] srfi-64: Accept complex numbers in test-approximate. Date: Sat, 26 Oct 2024 22:26:02 +0200 Message-ID: <87ed42k3vp.fsf@wolfsden.cz> References: <20241026161015.21049-1-~@wolfsden.cz> <87ed42vkwp.fsf@gnu.org> <40FEB680-90BC-4915-AFE9-88F4B638E59A@sarc.name> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32595"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 74031@debbugs.gnu.org, Ludovic =?UTF-8?Q?Court=C3=A8s?= To: lloda Original-X-From: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Sat Oct 26 22:26:48 2024 Return-path: Envelope-to: guile-bugs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1t4nN1-0008K3-CO for guile-bugs@m.gmane-mx.org; Sat, 26 Oct 2024 22:26:47 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t4nMl-0001lO-A4; Sat, 26 Oct 2024 16:26:31 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t4nMi-0001lF-KT for bug-guile@gnu.org; Sat, 26 Oct 2024 16:26:28 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t4nMi-0007Ji-Bj for bug-guile@gnu.org; Sat, 26 Oct 2024 16:26:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=4RExkZ2cJ6C0lK+PvXwEHgUy4XARn5nvUjrQ73l+m5c=; b=fwWZ9wiSZ8mxfoMzy8R1O265W9swiRGChxRnvJSxVbeGva/KeDUxZPeseKU3EI4sfu73Y6zMah94yj/pnix9JS3UgXLG6rFwKppAgEvJKGQ49FtxTy9v1VCbYMHaMysu9wd3Ns+REKhLV7m+fzT+U3Bk7OdSKwIklnGW08YfT6MCceg+lxHmCrUCBrS5GKr4QhXo64bS5PopppCX3uNjKS8miEB8mxo5T8n/RWyYVJPeyt3ybwsGxEJGmW6n1Gvg7je4jJcdYYSFOgX1bixbdszTSkmnWeiUuVppJ9oEWH5hozEoFUGvTDl/7XzgreJY6MOU/CIR3QCnb0Z/kEEtuw==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1t4nNG-0000Kg-1p for bug-guile@gnu.org; Sat, 26 Oct 2024 16:27:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Tomas Volf <~@wolfsden.cz> Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Sat, 26 Oct 2024 20:27:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74031 X-GNU-PR-Package: guile X-GNU-PR-Keywords: patch Original-Received: via spool by 74031-submit@debbugs.gnu.org id=B74031.17299744001244 (code B ref 74031); Sat, 26 Oct 2024 20:27:02 +0000 Original-Received: (at 74031) by debbugs.gnu.org; 26 Oct 2024 20:26:40 +0000 Original-Received: from localhost ([127.0.0.1]:42715 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t4nMu-0000Jz-91 for submit@debbugs.gnu.org; Sat, 26 Oct 2024 16:26:40 -0400 Original-Received: from wolfsden.cz ([37.205.8.62]:36142) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <~@wolfsden.cz>) id 1t4nMs-0000Jo-0F for 74031@debbugs.gnu.org; Sat, 26 Oct 2024 16:26:39 -0400 Original-Received: by wolfsden.cz (Postfix, from userid 104) id 2D9A632AC29; Sat, 26 Oct 2024 20:26:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=wolfsden.cz; s=mail; t=1729974363; bh=ASx+xwSPXU+uvuOhhqeNwKXZcIIIcGgGDFbNUOiXxts=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=nyqyiZbILaxWW+FwTzu2ft2NSr6Du2phOdyfw/LTKt8g/b1Tx+lZpbDufsGyZ/Xjm DUbRXSyW3M9RNlPe9gD+KTynpZA+22l2reSuvbbncY9qHPd+yUj7aiwLJCsyCHOV+t qnheb5xZWcjD3p6M1+wbonq04f2XVEHDMEu5HejN3ym+Lw49Q7/Y/Un3lO7uoBoddB HazHXI1XM6hV12p8Lb6lUa/LKmlTEV+a3yAj3XU8R2J+d2kKYGEgKm8MTNAk3oVN9y yxt3pdPcmKyWfw9X3Q9+7xPaliB4kiryV8fKZMsJj/HLtSgGvVX30LiwnPDwDR7v53 pXxYDT7sSXnbprVSdBmQgijsfPQx5F4FxkN/CiqUvDdX9t4NrQ3qKkp5v6iT1w9s5Y UwsbU6LooNn7n7cS6rfm8cj0ziAMGUrFclKppq66uidwHMsCfG8ftBq6aBSztDU/pN AfuWWugZYYWXJ+r3StJVlMSZnodpG63VOhrhx9HQe/k3AedtQBFOAdyyI7iT5J5nF9 kZtJ5hrMwB0BF5w/GvJvlcjaolPQNb1/TAYqrJFmFaOb5I9ch5PZrzh/0yvbOTZGYX Sx/YqOm79jIi271+DatiMpZI9OaMrr5iMGP8pVhUZeAsGm/ngMEcdVaCGheOJyFc63 Vb1qiAPjDuwhaaRmmdZQvQLw= Original-Received: from localhost (unknown [128.0.188.242]) by wolfsden.cz (Postfix) with ESMTPSA id BE05D334261; Sat, 26 Oct 2024 20:26:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=wolfsden.cz; s=mail; t=1729974362; bh=ASx+xwSPXU+uvuOhhqeNwKXZcIIIcGgGDFbNUOiXxts=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=F3EdC4mPFR6vLrLkU08upSc2OSQKivMxnEHHOFgoyoVGfpUTHuOhsPZORYoaXpqQ2 EIqUwogWHA4DcKR0zDK7r9LbfN7brdqz/hAi3G7qzw+CJttNFlb2g2dz4FnVPPZr2X Oxw32ofJTsg/PpBiye2c8pK/NuLFeUbtbRYTb/y4TydRrR5ZtdFeqmoLYsOkagZPD6 JfTNKIfOGSjqgPCL6nO/jofjlcauCWYAroQQMGYOForgIIA92EH3ZhCrs5bF2WUBio TmzsOG+BzY52/h85bilY2dgojDJ6RlVRKsg0SBIE8MkNURaqIl7CYY3kjAcEvR/CkK wKOlvTNhY6AczfygDRJRrsmDLDydQKSisazSzphXIRJfi94F8zShhhlQsRt2r0jhwW 65SjwSMDH8eW76oWH3lGEEGvbIGT16ieJnSaMKFTQIbHtpzRj/QEjV6QqYB3Poqhyw pL8BZoeVM7abKFry/Uuy3JApZTBGP1sMilIG4qooi1xPl0WQryotjdkKja1aNt4Ruq 60CEUJ8DWvotDLIBGIp5mKxd03cV2Eeo/O8G+3XzQkZXpcCVLBGlFKOyPNEQl2KPdb lR4YqUCIh7u/Gj3/42QNTKjPkceAeN5ey4syjpsz+Ry/iI3FZ8ziXKZyEy34vOlEzY aVmBWEV3L8I5l2JXHDi3GkRs= In-Reply-To: <40FEB680-90BC-4915-AFE9-88F4B638E59A@sarc.name> (lloda@sarc.name's message of "Sat, 26 Oct 2024 20:46:25 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Original-Sender: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.lisp.guile.bugs:11088 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hello, lloda writes: >> On 26 Oct 2024, at 19:22, Ludovic Court=C3=A8s wrote: >>=20 >> Hi, >>=20 >> (Cc: lloda.) >>=20 >> Tomas Volf <~@wolfsden.cz> skribis: >>=20 >>> The specification mandates reals, but the reference implementation >>> supports complex numbers. So as implementation extension, support them >>> as well. >>>=20 >>> * module/srfi/srfi-64.scm (within-epsilon): Support complex arguments. >>> --- >>> Proposal for how to extend test-approximate to handle complex arguments. >>> However it differs from the original one. That one expected `error' to= be a >>> real number, and used it for comparing both real parts and imaginary pa= rts. >>>=20 >>> To me, that seems weird. I would consider it useful to be able to have >>> different errors for real and imaginary parts. >>>=20 >>> However I cannot remember the last time I have used complex numbers, so= I am not >>> sure I am qualified to have an opinion here. What do other people thin= k? >>=20 >> Not sure either. Daniel, is that what you would expect? >>=20 >> Perhaps we should check the reference implementation? >>=20 >> Ludo=E2=80=99. > > Sorry, I didn't notice this. I replied on another message, but to be clea= r, the > expected error should always be a real number, no matter what you're > comparing. Got it, I have sent v2 using the same logic the original implementation did (according to your message "Chebyshev distance"). Since we are doing this for purpose of backwards compatibility, it makes sense to just restore the original behavior as it was. > If one wants to have separate errors for real and imaginary parts, > then one can simply use test-approximate on the real and imaginary parts > separately. By the same logic, if one wants to use the standard compliant test-approximate with complex numbers, one can simply call it on real and imaginary parts separately. ^_^ Tomas =2D-=20 There are only two hard things in Computer Science: cache invalidation, naming things and off-by-one errors. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJCBAEBCgAsFiEEt4NJs4wUfTYpiGikL7/ufbZ/wakFAmcdUFoOHH5Ad29sZnNk ZW4uY3oACgkQL7/ufbZ/wam5hA//ceD3IFcvRJoLKMPdqhMH4A2vgcFgxwrm/HWI a+gLEvFCJPIOx9E/TxwvdMhZbtyjU7sdba+hXrqRFBKIzHxJy4z2aWwMP+ZZBzzp yopx/anqBFSSZbQ30FIVdM/m0fvBXYDT/g/rrkaOwafciCKh7Lr4c7ZDgMpVf2ah zokJmL+buO+NF9Cn7hZk36W/d7FkPe1VA/C4QoO+XRiR0YPZFWNtS86zXF1ydUUk aARzRmdYsmXKuV/6s8aX6/7CkhVOu0chNvIqMDQ+HpIkt0Z5lGd0qvj7h00poHqa u/9bGYZ7gx0VWIZLFfpCv56js6H+UyVMTN246fnRQ2lC6gYEvVvjw4SwO18ZXl8l CmQtocmcZWN6w9z4vSsnhokdEv0YXQ+8GHwu/Mvj64T7Bx6WNgi/X+o9RDzfBc5f +yXogq0R7tQtBtWwGwWFmPDIqvPI3W+qR6XFfrUgKPIYUxNr5HurXvkfvBykk6xg 6voDaPGQrall6slhS34wGutyrZMogzV42Gje2iqjfrSD4fcwAO4gkfv/sEwAb/OR 4ePjpcVQZomwgsPKO4PJDCKyNX4I1p+mjKETPdUKSR+xRKquB2KAMAeQQEEl2AI2 EMKkLrgrLCUOi6l52OuKs5wOeyDQKkhWVBJOHhu0Jkyf2YVQ1BAjegFSAp6VksQ6 PPGTc3U= =VpvS -----END PGP SIGNATURE----- --=-=-=--