Where is isnan source code?

Due to the layers of standards, the included files for C ++ are a rat nest. I tried to find out what actually causes __isnan, and could not find anywhere with the actual definition.

So, I just compiled with -S to see the assembly, and if I write:

#include <ieee754.h>

void f(double x) {
  if (__isinf(x) ...

  if (__isnan(x)) ...
}

Both of these procedures are called. I would like to see the actual definition and possibly reorganize things like the built-in, as this should be just a comparison, although it is difficult to achieve when the value is in the floating point register.

In any case, is this a good idea, the question is: WHERE is the source code for __isnan(x)?

+3
source share
2 answers

Glibc sysdeps . , , sysdeps/ieee754/dbl-64/s_isnan.c. git grep __isnan.

( ++ , C , glibc .)

+3

, , glibc.

+1

Source: https://habr.com/ru/post/1774978/


All Articles