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: Arun Giridhar
Subject: [Octave-bug-tracker] [bug #64692] colon range includes an extra value
Date: Fri, 22 Sep 2023 12:45:48 -0400 (EDT)

Update of bug #64692 (project octave):

                Severity:              3 - Normal => 2 - Minor              
                Priority:              5 - Normal => 3 - Low                

    _______________________________________________________

Follow-up Comment #9:

Just for comparison, I ran this in Nelson (version '0.7.9.0 (Freedom)') . Here
is what I got:


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

>> -2 : (0.3 - 0.1 - 0.2)
ans =
    -2    -1     0

>> 1.8 : 0.05 : 1.9
ans =
    1.8000    1.8500

>> 1.9 : -0.05 : 1.8
ans =
    1.9000    1.8500


It seems to indicate that the question of deducing intent in the presence of
floating point roundoff is subjective at best, so there's no single way to
cover all cases. Each program does its own thing, even when they're aiming for
compatibility.

If anyone wants to experiment with Octave's rounding rules for ranges, they're
in Range.cc, in the functions xteq() and xnumel_internal().

Lowering the priority for this bug, since there are many workarounds.


    _______________________________________________________

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]