mirror of
https://github.com/OPM/opm-simulators.git
synced 2026-10-24 22:57:42 -05:00
Uses lowest() instead of min/max for initial value
Replaces the custom handling (post g++-4.4) of minimum and maximum values for integral and floating-point types with std::numeric_limits::lowest().
This commit is contained in:
1 parent
d8e0de2960
commit
ee1eb83d27
1 file changed
+1
-11
@@ -254,17 +254,7 @@ private:
|
||||
template<class T>
|
||||
T getInitialValue()
|
||||
{
|
||||
//g++-4.4 does not support std::numeric_limits<T>::lowest();
|
||||
// we rely on IEE 754 for floating point values and use min()
|
||||
// for integral types.
|
||||
if( std::is_integral<T>::value )
|
||||
{
|
||||
return std::numeric_limits<T>::min();
|
||||
}
|
||||
else
|
||||
{
|
||||
return -std::numeric_limits<T>::max();
|
||||
}
|
||||
return std::numeric_limits<T>::lowest();
|
||||
}
|
||||
/// \brief Get the underlying binary operator.
|
||||
///
|
||||
|
||||
Reference in new issue
Block a user