diff --git a/Modules/Core/Common/include/itkBresenhamLine.hxx b/Modules/Core/Common/include/itkBresenhamLine.hxx index d7eac6d53b7..d86d2ef33db 100644 --- a/Modules/Core/Common/include/itkBresenhamLine.hxx +++ b/Modules/Core/Common/include/itkBresenhamLine.hxx @@ -41,7 +41,8 @@ BresenhamLine::BuildLine(LType Direction, IdentifierType length) -> // compute actual line length because the shorter distance // the larger deviation due to rounding to integers const IdentifierType mainDirectionLen = length - 1; - const double euclideanLineLen = mainDirectionLen / itk::Math::Absolute(Direction[maxDistanceDimension]); + const double euclideanLineLen = + static_cast(mainDirectionLen) / static_cast(itk::Math::Absolute(Direction[maxDistanceDimension])); // we are going to start at 0 constexpr IndexType StartIndex{ 0 };