4
0
mirror of git://sourceware.org/git/newlib-cygwin.git synced 2025-02-02 04:20:28 +08:00

RISC-V: NaN should return 0 for finite[f]

This commit is contained in:
Kito Cheng 2020-10-28 23:41:26 +08:00 committed by Ken Brown
parent 67f6939275
commit 906849c4f9
2 changed files with 2 additions and 2 deletions

View File

@ -44,7 +44,7 @@
int finite(double x)
{
long fclass = _fclass_d (x);
return (fclass & FCLASS_INF) == 0;
return (fclass & (FCLASS_INF | FCLASS_NAN)) == 0;
}
#else
#include "../../common/s_finite.c"

View File

@ -41,7 +41,7 @@
int finitef(float x)
{
long fclass = _fclass_f (x);
return (fclass & FCLASS_INF) == 0;
return (fclass & (FCLASS_INF | FCLASS_NAN)) == 0;
}
#else
#include "../../common/sf_finite.c"