Skip to content
Snippets Groups Projects
Commit 5afe77a1 authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

+ Numeric::ignoreDenormalized

parent 669bccec
No related branches found
No related tags found
1 merge request!2018further cleanup prior to #724 etc
...@@ -46,3 +46,8 @@ bool Numeric::almostEqual(const R3& a, const R3& b, int ulp) ...@@ -46,3 +46,8 @@ bool Numeric::almostEqual(const R3& a, const R3& b, int ulp)
return almostEqual(a.x(), b.x(), ulp) && almostEqual(a.y(), b.y(), ulp) return almostEqual(a.x(), b.x(), ulp) && almostEqual(a.y(), b.y(), ulp)
&& almostEqual(a.z(), b.z(), ulp); && almostEqual(a.z(), b.z(), ulp);
} }
double Numeric::ignoreDenormalized(double value)
{
return (std::fpclassify(value) == FP_SUBNORMAL) ? 0.0 : value;
}
...@@ -32,6 +32,7 @@ double relativeDifference(double a, double b); ...@@ -32,6 +32,7 @@ double relativeDifference(double a, double b);
bool almostEqual(double a, double b, int ulp); bool almostEqual(double a, double b, int ulp);
bool almostEqual(const R3& a, const R3& b, int ulp); bool almostEqual(const R3& a, const R3& b, int ulp);
double ignoreDenormalized(double value);
} // namespace Numeric } // namespace Numeric
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment