Skip to content

Commit

Permalink
Renamed the moduloFloat and moduloDouble methods into modulo
Browse files Browse the repository at this point in the history
  • Loading branch information
rlagneau committed Oct 31, 2023
1 parent 0762907 commit e03dfe3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions modules/core/include/visp3/core/vpMath.h
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ class VISP_EXPORT vpMath
* \param[in] modulo The divider.
* \return float The rest as in a modulo operation.
*/
static float moduloFloat(const float &value, const float &modulo)
static float modulo(const float &value, const float &modulo)
{
float quotient = std::floor(value / modulo);
float rest = value - quotient * modulo;
Expand All @@ -187,7 +187,7 @@ class VISP_EXPORT vpMath
* \param[in] modulo The divider.
* \return double The rest as in a modulo operation.
*/
static double moduloDouble(const double &value, const double &modulo)
static double modulo(const double &value, const double &modulo)
{
double quotient = std::floor(value / modulo);
double rest = value - quotient * modulo;
Expand Down
2 changes: 1 addition & 1 deletion modules/core/src/image/vpImageCircle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1003,7 +1003,7 @@ float vpImageCircle::computeAngularCoverageInRoI(const vpRect &roi, const float
}

if (delta_theta < 0 || delta_theta > 2.f * M_PIf) { // Needed since M_PIf is used
float rest = vpMath::moduloFloat(delta_theta, 2.f * M_PIf);
float rest = vpMath::modulo(delta_theta, 2.f * M_PIf);
if (rest < roundingTolerance && (delta_theta < -M_PIf || delta_theta > M_PIf)) {
// If the angle is a negative multiple of 2.f * M_PIf we consider it to be 2.f * M_PIf
delta_theta = 2.f * M_PIf;
Expand Down

0 comments on commit e03dfe3

Please sign in to comment.