compare and a float
in
Programming Questions
•
2 years ago
Is this a good way (it works but i just wonder how other people would do it cause i think it can be done easier):
(it's part of a compare function (and note, it's in a java file (goes it has to)))
(it's part of a compare function (and note, it's in a java file (goes it has to)))
- IBI_INTERVAL_SORT_asc {
public int compare(IBI_Sample ibi1, IBI_Sample ibi2) {
float test = ibi2.interval - ibi1.interval;
if(test > 0) return 1;
if(test < 0) return -1;
else return 0;
}},
1