Kito Cheng writes: > +#if defined(__riscv_flen) && __riscv_flen >= 64 > +#include "riscv_math.h" > +int finite(double x) > +{ > + long fclass = _fclass_d (x); > + return (fclass & FCLASS_INF) == 0; > +} This also needs to check for FCLASS_NAN: return (class & (FCLASS_INF|FCLASS_NAN)) == 0; Same for finitef -- -keith