From: Tomas Volf <~@wolfsden.cz>
To: lloda <lloda@sarc.name>
Cc: 74031@debbugs.gnu.org, "Ludovic Courtès" <ludo@gnu.org>
Subject: bug#74031: [PATCH] srfi-64: Accept complex numbers in test-approximate.
Date: Sat, 26 Oct 2024 22:26:02 +0200 [thread overview]
Message-ID: <87ed42k3vp.fsf@wolfsden.cz> (raw)
In-Reply-To: <40FEB680-90BC-4915-AFE9-88F4B638E59A@sarc.name> (lloda@sarc.name's message of "Sat, 26 Oct 2024 20:46:25 +0200")
[-- Attachment #1: Type: text/plain, Size: 2043 bytes --]
Hello,
lloda <lloda@sarc.name> writes:
>> On 26 Oct 2024, at 19:22, Ludovic Courtès <ludo@gnu.org> wrote:
>>
>> Hi,
>>
>> (Cc: lloda.)
>>
>> Tomas Volf <~@wolfsden.cz> skribis:
>>
>>> The specification mandates reals, but the reference implementation
>>> supports complex numbers. So as implementation extension, support them
>>> as well.
>>>
>>> * 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 parts.
>>>
>>> To me, that seems weird. I would consider it useful to be able to have
>>> different errors for real and imaginary parts.
>>>
>>> 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 think?
>>
>> Not sure either. Daniel, is that what you would expect?
>>
>> Perhaps we should check the reference implementation?
>>
>> Ludo’.
>
> Sorry, I didn't notice this. I replied on another message, but to be clear, 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
--
There are only two hard things in Computer Science:
cache invalidation, naming things and off-by-one errors.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 853 bytes --]
next prev parent reply other threads:[~2024-10-26 20:26 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-26 16:07 bug#74031: [PATCH] srfi-64: Accept complex numbers in test-approximate Tomas Volf
2024-10-26 17:22 ` Ludovic Courtès
2024-10-26 18:46 ` lloda
2024-10-26 20:26 ` Tomas Volf [this message]
2024-10-26 18:35 ` lloda
2024-10-26 20:19 ` bug#74031: [PATCH v2] " Tomas Volf
2024-10-26 21:06 ` bug#74031: [PATCH v3] " Tomas Volf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87ed42k3vp.fsf@wolfsden.cz \
--to=~@wolfsden.cz \
--cc=74031@debbugs.gnu.org \
--cc=lloda@sarc.name \
--cc=ludo@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).