| 396 | |
| 397 | template<typename T> |
| 398 | bool Validate(const T& param1, const T& param2) { |
| 399 | if constexpr (std::is_same<T, double>::value) { |
| 400 | auto min = std::min(countDecimalPlaces(param1), countDecimalPlaces(param2)); |
| 401 | double threshold = pow(0.1, min); |
| 402 | double difference = param1 - param2; |
| 403 | if (difference > -threshold && difference < threshold) { |
| 404 | return true; |
| 405 | } |
| 406 | else |
| 407 | { |
| 408 | return false; |
| 409 | } |
| 410 | } |
| 411 | else { |
| 412 | return param1 == param2; |
| 413 | } |
| 414 | |
| 415 | } |
| 416 | |
| 417 | |
| 418 |
no test coverage detected