mirror of
https://github.com/minetest/irrlicht.git
synced 2024-11-17 21:23:48 +01:00
Ensure that std::abs is used and not integer abs
This commit is contained in:
parent
c83f28431b
commit
270b2bec6e
@ -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>
|
||||
|
||||
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user