Skip to content

Commit

Permalink
Merge pull request #136 from a4lg/more-portable-ratios
Browse files Browse the repository at this point in the history
Bug Fix+Portability: Improve portability by integral division
  • Loading branch information
jonjoliver authored Oct 8, 2024
2 parents f0c0af7 + eb6f8c5 commit 809279e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/tlsh_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -784,8 +784,8 @@ void TlshImpl::final(int fc_cons_option)
}

this->lsh_bin.Lvalue = l_capturing(this->data_len);
this->lsh_bin.Q.QR.Q1ratio = (unsigned int) ((float)(q1*100)/(float) q3) % 16;
this->lsh_bin.Q.QR.Q2ratio = (unsigned int) ((float)(q2*100)/(float) q3) % 16;
this->lsh_bin.Q.QR.Q1ratio = (unsigned int) ((unsigned long long) q1 * 100 / q3) % 16;
this->lsh_bin.Q.QR.Q2ratio = (unsigned int) ((unsigned long long) q2 * 100 / q3) % 16;
this->lsh_code_valid = true;
}

Expand Down

0 comments on commit 809279e

Please sign in to comment.