Skip to content

Commit 809279e

Browse files
authored
Merge pull request #136 from a4lg/more-portable-ratios
Bug Fix+Portability: Improve portability by integral division
2 parents f0c0af7 + eb6f8c5 commit 809279e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎src/tlsh_impl.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -784,8 +784,8 @@ void TlshImpl::final(int fc_cons_option)
784784
}
785785

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

0 commit comments

Comments
 (0)