bug: checking against NaN is always false
conradsnicta opened this issue · 0 comments
conradsnicta commented
The following statement in fastplm.cpp
always evaluates to false:
Line 178 in 560d317
According to the documentation for std::numeric_limits::quiet_NaN()
A NaN never compares equal to itself.
Armadillo uses std::numeric_limits<T>::quiet_NaN()
for datum::nan, so the same caveat applies.
To fix this, use std::isnan() instead:
if (std::isnan(coef(i))) {