This compiles fine
#include <math.h>int main(void) { double i = sqrt(9.0);}
If I change 9.0 to -9.0, then my compiler (GNU C) gives an error about an undefined reference to 'sqrt'.
I was expecting the sqrt function to return NaN or an exception. How does the C library only define sqrt for non-negative arguments?