Skip to content

Commit

Permalink
STYLE: Remove pow, add constexpr to variable BSplineTransformInitializer
Browse files Browse the repository at this point in the history
Using left-shift instead of `std::pow(2, x)` allows the local variable
`BSplineTransformDomainEpsilon` to be declared `constexpr`.
  • Loading branch information
N-Dekker authored and dzenanz committed Feb 26, 2025
1 parent fcae41b commit e29e5cc
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ BSplineTransformInitializer<TTransform, TImage>::InitializeTransform() const
// We also store the corners using the point set class which gives us easy
// access to the bounding box.

const CoordinateType BSplineTransformDomainEpsilon = std::pow(2.0, -3);
constexpr CoordinateType BSplineTransformDomainEpsilon{ 1.0 / double{ 1U << 3 } };

ContinuousIndexType startIndex;
for (unsigned int i = 0; i < SpaceDimension; ++i)
Expand Down

0 comments on commit e29e5cc

Please sign in to comment.