diff --git a/libs/kimath/include/math/util.h b/libs/kimath/include/math/util.h index 40417d1949..541471b83f 100644 --- a/libs/kimath/include/math/util.h +++ b/libs/kimath/include/math/util.h @@ -102,11 +102,14 @@ constexpr ret_type KiROUND( fp_type v ) else return 0; } - else if( std::isnan( v ) ) + else if constexpr( std::is_floating_point_v ) { - kimathLogOverflow( double( v ), typeid( ret_type ).name() ); + if( std::isnan( v ) ) + { + kimathLogOverflow( double( v ), typeid( ret_type ).name() ); - return 0; + return 0; + } } return ret_type( max_ret( ret ) );