|
From: | Julien Bect |
Subject: | [Octave-bug-tracker] [bug #42589] Inaccurate results with the colon operator |
Date: | Thu, 19 Jun 2014 17:01:07 +0000 |
User-agent: | Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:26.0) Gecko/20100101 Firefox/26.0 |
URL: <http://savannah.gnu.org/bugs/?42589> Summary: Inaccurate results with the colon operator Project: GNU Octave Submitted by: jbect Submitted on: jeu. 19 juin 2014 17:01:06 GMT Category: None Severity: 3 - Normal Priority: 5 - Normal Item Group: Inaccurate Result Status: None Assigned to: None Originator Name: Originator Email: Open/Closed: Open Discussion Lock: Any Release: dev Operating System: GNU/Linux _______________________________________________________ Details: I get this result with Octave 3.6.4 and 3.9.0+ (both built with gcc 4.7.3 on Ubuntu 13.04 i686-linux-gnu): >> x = -1:.1:1; x(11) ans = 5.55111512312578e-17 Matlab (2012a) returns exactly 0. Trying to understand the cause of this error, I proceeded with some additional experiments which give rather surprising results: >> x = -1 + ((0:10) * .1); x(11) ans = 5.55111512312578e-17 >> x = -1 + ((9:10) * .1); x(2) ans = 2.77555756156289e-17 >> x = -1 + (10 * .1) x = 0 Again, Matlab returns exactly 0 in all three cases. Could somebody please confirm these results before I start to investigate ? _______________________________________________________ Reply to this item at: <http://savannah.gnu.org/bugs/?42589> _______________________________________________ Message posté via/par Savannah http://savannah.gnu.org/
[Prev in Thread] | Current Thread | [Next in Thread] |