gcc - Where is the source code for isnan? -
because of layers of standards, include files c++ rats nest. trying figure out __isnan
calls, , couldn't find anywhere actual definition.
so compiled -s see assembly, , if write:
#include <ieee754.h> void f(double x) { if (__isinf(x) ... if (__isnan(x)) ... }
both of these routines called. see actual definition, , possibly refactor things inline, since should bit comparison, albeit 1 hard achieve when value in floating point register.
anyway, whether or not it's idea, question stands: source code __isnan(x)
?
glibc has versions of code in sysdeps folder each of systems supports. 1 you’re looking in sysdeps/ieee754/dbl-64/s_isnan.c. found git grep __isnan
.
(while c++ headers include code templates, functions c library not, , have inside glibc or whichever.)
Comments
Post a Comment