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 16:43:43 -0400 (EDT)

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

[comment #13 comment #13:]

> How MATLAB Stores Floating-Point Numbers
> MATLAB constructs its double and single floating-point data types according
to IEEE format and follows the round to nearest, ties to even rounding mode by
default.

That is what IEEE 754 does by default anyway. They could have simplified it by
saying they're not changing the default hardware rounding mode of IEEE
floating points. This makes our life a bit easier because we don't need to set
rounding mode differently, but there's still inconsistency in spite of that.

I'm experimenting now with a conditional warning in Range.cc, something like
this:

+verbatim+
delta = abs (calculated final value - specified final value);
if (delta <= 3 * eps)   // really close, probably intended
   include the final value
elseif (delta > 1e-12)  // far away, likely not intended
   exclude the final value if not excluded already
else // delta is small but bigger than roundoff error
   warning ("Dangerous use of floating point in range")





    _______________________________________________________

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]