|
From: | anonymous |
Subject: | [Octave-bug-tracker] [bug #51282] Column vector and equality operator are not playing nice together. |
Date: | Tue, 20 Jun 2017 19:41:59 -0400 (EDT) |
User-agent: | Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36 |
URL: <http://savannah.gnu.org/bugs/?51282> Summary: Column vector and equality operator are not playing nice together. Project: GNU Octave Submitted by: None Submitted on: Tue 20 Jun 2017 11:41:58 PM UTC Category: Interpreter Severity: 3 - Normal Priority: 5 - Normal Item Group: Inaccurate Result Status: None Assigned to: None Originator Name: Nathan Howard Originator Email: address@hidden Open/Closed: Open Discussion Lock: Any Release: 4.2.1 Operating System: Microsoft Windows _______________________________________________________ Details: It looks like the equality operator is picking up a rounding error issue when using a column vector, such that: >> d = (-1:.1:1); >> sum(d==-0.5) ans = 1 >> sum(d==-0.4) ans = 0 >> sum(d==-0.39999999999999999) ans = 1 >> sum(d==-0.3999999999999999) ans = 0 This happens in both format short and long modes. _______________________________________________________ Reply to this item at: <http://savannah.gnu.org/bugs/?51282> _______________________________________________ Message sent via/by Savannah http://savannah.gnu.org/
[Prev in Thread] | Current Thread | [Next in Thread] |