Avoid divide-by-zero.

This commit is contained in:
Jeff Young 2020-01-15 18:21:09 +00:00
parent dcfb7cadce
commit e42788a3eb
1 changed files with 5 additions and 0 deletions

View File

@ -1307,6 +1307,11 @@ int ts_fequals( tsReal x, tsReal y )
{
return 1;
}
// KIDAD FIX for divide-by-zero
else if( y == 0.0 )
{
return x == 0.0;
}
else
{
const tsReal r = (tsReal) fabs( x ) > (tsReal) fabs( y ) ?