KiROUND: make sure input type is floating point before checking for nan.

This commit is contained in:
Alex Shvartzkop 2024-01-16 17:25:46 +03:00
parent f99505e190
commit 4c630e5aec
1 changed files with 6 additions and 3 deletions

View File

@ -102,11 +102,14 @@ constexpr ret_type KiROUND( fp_type v )
else else
return 0; return 0;
} }
else if( std::isnan( v ) ) else if constexpr( std::is_floating_point_v<fp_type> )
{ {
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 ) ); return ret_type( max_ret( ret ) );