Commit b889b631 authored by Sean McBride's avatar Sean McBride

Introduce VTK's first use of C++11's std::lround() (in a test)

lround's semantics are better than vtkMath::Round because it
doesn't provoke undefined behaviour with Inf, large values, etc.

If this one use works everywhere, more uses can follow...
parent 27579ded
......@@ -50,8 +50,8 @@ static vtkSmartPointer<vtkRectilinearGrid> MakeRectilinearGrid()
int extent[6];
for (int i = 0; i < 6; i += 2)
{
extent[i] = vtkMath::Round(vtkMath::Random(-10, 10));
extent[i+1] = extent[i] + vtkMath::Round(vtkMath::Random(0, 10));
extent[i] = std::lround(vtkMath::Random(-10, 10));
extent[i+1] = extent[i] + std::lround(vtkMath::Random(0, 10));
}
grid->SetExtent(extent);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment