Beware of the difference between ::abs and std::abs
When you need to use the absolute value from a variable, use std::abs
(usually residing in std::fabs
.
When you need to use the absolute value from a variable, use std::abs
(usually residing in std::fabs
.
Recently we had occasional, but serious problems with some software we’re making. The problems were with invalid floating point numbers or C++ NAN and IND/INF errors.