##// END OF EJS Templates
Removed forgotten files form previous impl of VC, fixed wrong submodules...
Removed forgotten files form previous impl of VC, fixed wrong submodules init (was always erasing changes :( ) Signed-off-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>

File last commit:

r9:b3317a5111ec
r31:dec007be0b03
Show More
Numeric.h
26 lines | 720 B | text/x-c | CLexer
Added DateTimeRange unit Tests...
r6 #ifndef NUMERIC_H
#define NUMERIC_H
First init from SciQLop Core module...
r0 #include <cmath>
#include <limits>
#include <type_traits>
#include <algorithm>
Added DateTimeRange unit Tests...
r6 namespace SciQLop::numeric {
First init from SciQLop Core module...
r0 /*
taken from here https://en.cppreference.com/w/cpp/types/numeric_limits/epsilon
*/
template<class T>
typename std::enable_if<!std::numeric_limits<T>::is_integer, bool>::type
Many fixes plus implemented var synchronization...
r9 almost_equal(T x, T y, int ulp=1)
First init from SciQLop Core module...
r0 {
// the machine epsilon has to be scaled to the magnitude of the values used
// and multiplied by the desired precision in ULPs (units in the last place)
return std::abs(x-y) <= std::numeric_limits<T>::epsilon() * std::abs(x+y) * ulp
// unless the result is subnormal
|| std::abs(x-y) < std::numeric_limits<T>::min();
}
Added DateTimeRange unit Tests...
r6
}
#endif