[PD-dev] [ pure-data-Bugs-1996275 ] [change] lets some duplicates thru
SourceForge.net
noreply at sourceforge.net
Tue Jun 17 18:38:41 CEST 2008
Bugs item #1996275, was opened at 2008-06-17 12:38
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=478070&aid=1996275&group_id=55736
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: puredata
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Hans-Christoph Steiner (eighthave)
Assigned to: Nobody/Anonymous (nobody)
Summary: [change] lets some duplicates thru
Initial Comment:
Sometimes some duplicates get through [change] since it is doing a != for the comparison. Instead it should do a comparison with a set precision, something like this:
http://howto.wikia.com/wiki/Howto_compare_float_numbers_in_the_C_programming_language
//compares if the float f1 is equal with f2 and returns 1 if true and 0 if false
int compare_float(float f1, float f2)
{
float precision = 0.00001;
if (((f1 - precision) < f2) &&
((f1 + precision) > f2))
{
return 1;
}
else
{
return 0;
}
}
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=478070&aid=1996275&group_id=55736
More information about the Pd-dev
mailing list