Fix smell and add new test

This commit is contained in:
2023-03-13 17:17:31 +01:00
parent d9a6f528f6
commit 14860ea0b9
2 changed files with 12 additions and 1 deletions

View File

@@ -25,7 +25,7 @@ namespace mdlp {
throw invalid_argument("wrong proposed num_cuts value");
}
if (proposed_cuts < 1)
return static_cast<size_t>(round(X.size() * proposed_cuts));
return static_cast<size_t>(round(static_cast<float>(X.size()) * proposed_cuts));
return static_cast<size_t>(proposed_cuts);
}