From: Marius Vollmer <marius.vollmer@uni-dortmund.de>
Cc: guile-devel@gnu.org
Subject: Re: bug in sort.c
Date: Tue, 19 Oct 2004 16:33:20 +0200 [thread overview]
Message-ID: <ljbreyydzj.fsf@troy.dt.e-technik.uni-dortmund.de> (raw)
In-Reply-To: <1097755656.5281.3487.camel@localhost> (Roland Orre's message of "Thu, 14 Oct 2004 14:07:36 +0200")
Roland Orre <roland.orre@neurologic.se> writes:
> The following two lines in scm_restricted_vector_sort_x
> are wrong:
>
> SCM_VALIDATE_INUM_RANGE (4, endpos,0, vlen+1);
> len = SCM_INUM (endpos) - spos;
>
> they should be:
>
> SCM_VALIDATE_INUM_RANGE (4, endpos,0, vlen);
> len = SCM_INUM (endpos) - spos + 1;
I think the code is correct: we need to have
0 <= startpos <= endpos <= vlen
The element with index endpos is not included in the sort, thus we
will sort
len = endpos - spos
elements.
The docstring needs to be clearer about this, tho.
_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-devel
prev parent reply other threads:[~2004-10-19 14:33 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-10-14 12:07 bug in sort.c Roland Orre
2004-10-19 14:33 ` Marius Vollmer [this message]
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=ljbreyydzj.fsf@troy.dt.e-technik.uni-dortmund.de \
--to=marius.vollmer@uni-dortmund.de \
--cc=guile-devel@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).