nan function requires -lm on some platforms - use of NAN is better, if available