[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #34260] bwdist macro igiving incorrect result
From: |
Jeffrey Cunningham |
Subject: |
[Octave-bug-tracker] [bug #34260] bwdist macro igiving incorrect result on x86_64 systems |
Date: |
Fri, 09 Sep 2011 21:16:04 +0000 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; en-us) AppleWebKit/531.2+ (KHTML, like Gecko) Version/5.0 Safari/531.2+ Debian/squeeze (2.30.6-1) Epiphany/2.30.6 |
URL:
<http://savannah.gnu.org/bugs/?34260>
Summary: bwdist macro igiving incorrect result on x86_64
systems
Project: GNU Octave
Submitted by: jkcunningham
Submitted on: Fri 09 Sep 2011 09:16:03 PM GMT
Category: Libraries
Severity: 3 - Normal
Priority: 5 - Normal
Item Group: Incorrect Result
Status: None
Assigned to: None
Originator Name: Jeffrey Cunningham
Originator Email:
Open/Closed: Open
Discussion Lock: Any
Release: 3.2.0
Operating System: GNU/Linux
_______________________________________________________
Details:
I am working with the __bwdist.cc code and found that this macro:
#define DIST_EUCLIDEAN(x,y) ((int)(x)*(x) + (y)*(y))
isn't being expanded correctly, as it produces negative results inside this
loop:
euclidean(bw, rows, cols, xdist, ydist);
/* Remember sqrt() for the final output */
for(int i=0; i<rows*cols; i++) {
D(i) = sqrt((double)DIST_EUCLIDEAN(xdist[i], ydist[i]));
}
Changing it to this fixes it:
#define DIST_EUCLIDEAN(x,y) ((double)(x)*(x) + (double)(y)*(y))
Regards,
Jeff Cunningham
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?34260>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
- [Octave-bug-tracker] [bug #34260] bwdist macro igiving incorrect result on x86_64 systems,
Jeffrey Cunningham <=