Skip to content
Snippets Groups Projects
Commit ca48be15 authored by Elias Pipping's avatar Elias Pipping Committed by Elias Pipping
Browse files

numeric_limits<double>::min() is positive!

Contrary to what one might expect, it is the smallest representable
*positive* number.

Using -max() works because by IEEE 754, floats are symmetric!
parent a284d076
No related branches found
No related tags found
No related merge requests found
...@@ -58,7 +58,7 @@ template <int dimension> class MyNonlinearity { ...@@ -58,7 +58,7 @@ template <int dimension> class MyNonlinearity {
void directionalDomain(const VectorType &, const VectorType &, void directionalDomain(const VectorType &, const VectorType &,
Interval<double> &dom) const { Interval<double> &dom) const {
dom[0] = std::numeric_limits<double>::min(); dom[0] = -std::numeric_limits<double>::max();
dom[1] = std::numeric_limits<double>::max(); dom[1] = std::numeric_limits<double>::max();
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment