Skip to content

Commit

Permalink
fix a bug
Browse files Browse the repository at this point in the history
  • Loading branch information
guolinke committed Oct 26, 2017
1 parent 2850fad commit 0f8b75c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion include/LightGBM/utils/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,7 @@ inline bool FindInBitset(const uint32_t* bits, int n, T pos) {

inline static bool CheckDoubleEqual(double a, double b) {
double lower = std::nextafter(a, -INFINITY);
double upper = std::nextafter(b, INFINITY);
double upper = std::nextafter(a, INFINITY);
return b >= lower && b <= upper;
}

Expand Down
2 changes: 1 addition & 1 deletion src/io/bin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ namespace LightGBM {
}

for (int i = 1; i < num_sample_values; ++i) {
if (Common::CheckDoubleEqual(values[i - 1], values[i])) {
if (!Common::CheckDoubleEqual(values[i - 1], values[i])) {
if (values[i - 1] < 0.0f && values[i] > 0.0f) {
distinct_values.push_back(0.0f);
counts.push_back(zero_cnt);
Expand Down

0 comments on commit 0f8b75c

Please sign in to comment.