On Win CE 7, std::abs uses abs instead of fabs

Submitted by Christian Schluchter

Assigned to Nobody

Link to original bugzilla bug (#619)
Operating system: Windows

Description

On WinEC7, std::abs is mapped to abs instead of fabs and returns an integer instead of a floating point number. So any floating point number will be reduced to the next lower int.

std::abs is used e.g. in MathFunctions.h, where the error can be reproduced e.g. by runnning array_1 test:

template<typename Scalar>
struct abs_impl
{
typedef typename NumTraits<Scalar>::Real RealScalar;
static inline RealScalar run(const Scalar& x)
{
using std::abs;
RealScalar test = abs(x); //x is some float e.g. 0.12345, test is then 0
return abs(x);
}
};

Blocking

#558 (closed)

Edited by Eigen Bugzilla