mirror of https://github.com/AxioDL/zeus.git
Math: Correct epsilon values for close_enough()
These two overloads should be using DBL_EPSILON.
This commit is contained in:
parent
6ac3066a6f
commit
c7694f6c84
|
@ -163,11 +163,11 @@ template <typename E>
|
||||||
|
|
||||||
[[nodiscard]] bool close_enough(const CVector2f& a, const CVector2f& b, float epsilon = FLT_EPSILON);
|
[[nodiscard]] bool close_enough(const CVector2f& a, const CVector2f& b, float epsilon = FLT_EPSILON);
|
||||||
|
|
||||||
[[nodiscard]] inline bool close_enough(float a, float b, double epsilon = FLT_EPSILON) {
|
[[nodiscard]] inline bool close_enough(float a, float b, double epsilon = DBL_EPSILON) {
|
||||||
return std::fabs(a - b) < epsilon;
|
return std::fabs(a - b) < epsilon;
|
||||||
}
|
}
|
||||||
|
|
||||||
[[nodiscard]] inline bool close_enough(double a, double b, double epsilon = FLT_EPSILON) {
|
[[nodiscard]] inline bool close_enough(double a, double b, double epsilon = DBL_EPSILON) {
|
||||||
return std::fabs(a - b) < epsilon;
|
return std::fabs(a - b) < epsilon;
|
||||||
}
|
}
|
||||||
} // namespace zeus
|
} // namespace zeus
|
||||||
|
|
Loading…
Reference in New Issue