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: anonymous
Subject: [Octave-bug-tracker] [bug #64692] colon range includes an extra value
Date: Mon, 18 Sep 2023 08:27:50 -0400 (EDT)

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

                 Summary: colon range includes an extra value
                   Group: GNU Octave
               Submitter: None
               Submitted: Mon 18 Sep 2023 12:27:48 PM UTC
                Category: None
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Incorrect Result
                  Status: None
             Assigned to: None
         Originator Name: Jeremie Knuesel
        Originator Email: knuesel@gmail.com
             Open/Closed: Open
                 Release: 6.4.0
         Discussion Lock: Any
        Operating System: GNU/Linux
           Fixed Release: None
         Planned Release: None


    _______________________________________________________

Follow-up Comments:


-------------------------------------------------------
Date: Mon 18 Sep 2023 12:27:48 PM UTC By: Anonymous
Consider the following:


octave> b = 0.3 - 0.1 - 0.2
b = -2.7756e-17

octave> -2:b
ans =

  -2  -1   0


Here the 0 should not be included: the documentation describes the 'b' value
of a:b as "a maximum value which the elements of the range will not exceed".
This was observed on Octave 6.4.0, and 8.0.1 using
https://octave-online.net/.

This is also different from Matlab's behavior:


>> b = 0.3 - 0.2 - 0.1
b =
  -2.7756e-17

>> -2:b
ans =
    -2    -1









    _______________________________________________________

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]