Skip to content

Commit

Permalink
Fix: change the validation check conform to std::uniform_int_distribu…
Browse files Browse the repository at this point in the history
…tion
  • Loading branch information
sunbuny committed Jan 23, 2025
1 parent c5a0f6b commit 42f71fb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cpp/open3d/utility/Random.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,13 @@ class UniformIntGenerator {
/// [low, low + 1, ... high].
///
/// \param low The lower bound (inclusive).
/// \param high The upper bound (exclusive). \p high must be > \p low.
/// \param high The upper bound (inclusive). \p high must be >= \p low.
UniformIntGenerator(const T low, const T high) : distribution_(low, high) {
if (low < 0) {
utility::LogError("low must be > 0, but got {}.", low);
}
if (low >= high) {
utility::LogError("low must be < high, but got low={} and high={}.",
if (low > high) {
utility::LogError("low must be <= high, but got low={} and high={}.",
low, high);
}
}
Expand Down

0 comments on commit 42f71fb

Please sign in to comment.