mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-07-10 23:21:47 +08:00
fix always true warning with gcc 4.7
(grafted from 32d7232aec1b5c78061548a00f0583ddd693e3e3 )
This commit is contained in:
parent
65a6d41510
commit
eea99eb4e0
@ -12,6 +12,7 @@
|
||||
template<typename T>
|
||||
void check_abs() {
|
||||
typedef typename NumTraits<T>::Real Real;
|
||||
Real zero(0);
|
||||
|
||||
if(NumTraits<T>::IsSigned)
|
||||
VERIFY_IS_EQUAL(numext::abs(-T(1)), T(1));
|
||||
@ -26,9 +27,9 @@ void check_abs() {
|
||||
if(NumTraits<T>::IsSigned)
|
||||
{
|
||||
VERIFY_IS_EQUAL(numext::abs(x), numext::abs(-x));
|
||||
VERIFY( numext::abs(-x) >= Real(0));
|
||||
VERIFY( numext::abs(-x) >= zero );
|
||||
}
|
||||
VERIFY( numext::abs(x) >= Real(0));
|
||||
VERIFY( numext::abs(x) >= zero );
|
||||
VERIFY_IS_APPROX( numext::abs2(x), numext::abs2(numext::abs(x)) );
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user