Skip to content

Commit

Permalink
floor => ceil
Browse files Browse the repository at this point in the history
  • Loading branch information
alavenant committed May 17, 2024
1 parent 641dfaf commit c18abdb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/filter_grid_decimation/GridDecimationFilter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ void GridDecimationFilter::processOne(BOX2D bounds, PointRef& point, PointViewPt

void GridDecimationFilter::createGrid(BOX2D bounds)
{
double d_width = std::floor((bounds.maxx - bounds.minx) / m_args->m_edgeLength) + 1;
double d_height = std::floor((bounds.maxy - bounds.miny) / m_args->m_edgeLength) + 1;
double d_width = std::ceil((bounds.maxx - bounds.minx) / m_args->m_edgeLength);
double d_height = std::ceil((bounds.maxy - bounds.miny) / m_args->m_edgeLength);

if (d_width < 0.0 || d_width > (std::numeric_limits<int>::max)())
throwError("Grid width out of range.");
Expand Down

0 comments on commit c18abdb

Please sign in to comment.