Skip to content
This repository has been archived by the owner on May 13, 2024. It is now read-only.

Commit

Permalink
Ensure that std::abs is used and not integer abs
Browse files Browse the repository at this point in the history
  • Loading branch information
paradust7 authored and sfan5 committed Feb 21, 2024
1 parent c83f284 commit 270b2be
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions include/irrMath.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
#pragma once

#include "irrTypes.h"
#include <math.h>
#include <cmath>
#include <float.h>
#include <stdlib.h> // for abs() etc.
#include <cstdlib> // for abs() etc.
#include <limits.h> // For INT_MAX / UINT_MAX
#include <type_traits>

Expand Down Expand Up @@ -197,7 +197,7 @@ namespace core
template <class T, std::enable_if_t<std::is_floating_point<T>::value, bool> = true>
inline bool equals(const T a, const T b, const T tolerance = roundingError<T>())
{
return abs(a - b) <= tolerance;
return std::abs(a - b) <= tolerance;
}

//! returns if a equals b, taking relative error in form of factor
Expand Down

0 comments on commit 270b2be

Please sign in to comment.