octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #64692] colon range includes an extra value


From: John W. Eaton
Subject: [Octave-bug-tracker] [bug #64692] colon range includes an extra value
Date: Sat, 23 Sep 2023 15:49:17 -0400 (EDT)

Follow-up Comment #32, bug #64692 (project octave):

I propose the attached changes.  I think they improve Matlab compatibility but
I had to make some changes to the expected results for some existing tests in
range.tst so it would help to verify the behavior of Matlab for the following
tests.  For these ranges, are all elements of the result integers or are any
non-integer limits preserved in the range result?  Is that behavior
consistent?


rng = 1 : (1001/250)/(1/250);
assert (numel (rng), 1000);
assert (rng(end), 1000);

rng = 2000: -1 : (1001/250)/(1/250);
assert (numel (rng), 1000);
assert (rng(end), 1001);

rng = 1 : (1001/250)/(1/250);
assert (numel (rng), (1000));
assert (rng(end), 1000);



(file #55164)

    _______________________________________________________

Additional Item Attachment:

File name: range-diffs.txt                Size:3 KB
    <https://file.savannah.gnu.org/file/range-diffs.txt?file_id=55164>



    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?64692>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]