mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-08 17:08:28 -04:00
AP_Math: Remove isnan check for non-float type
Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
This commit is contained in:
parent
937d7bf335
commit
6ee401cb00
@ -265,9 +265,11 @@ T constrain_value(const T amt, const T low, const T high)
|
|||||||
// the check for NaN as a float prevents propagation of floating point
|
// the check for NaN as a float prevents propagation of floating point
|
||||||
// errors through any function that uses constrain_value(). The normal
|
// errors through any function that uses constrain_value(). The normal
|
||||||
// float semantics already handle -Inf and +Inf
|
// float semantics already handle -Inf and +Inf
|
||||||
if (isnan(amt)) {
|
if (std::is_floating_point<T>::value) {
|
||||||
INTERNAL_ERROR(AP_InternalError::error_t::constraining_nan);
|
if (isnan(amt)) {
|
||||||
return (low + high) / 2;
|
INTERNAL_ERROR(AP_InternalError::error_t::constraining_nan);
|
||||||
|
return (low + high) / 2;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (amt < low) {
|
if (amt < low) {
|
||||||
|
Loading…
Reference in New Issue
Block a user