This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Should nanl(0) crash?
- From: Petter Reinholdtsen <pere at hungry dot com>
- To: libc-alpha at gnu dot org
- Date: Sat, 24 Jul 2004 23:02:13 +0200
- Subject: Should nanl(0) crash?
This code compile, run and print 0 on Tru64 Unix. On Linux, it
crashes with a segfault. Is it legal to call nanl(0)? I tried
checking the C standard, but that didn't make me wiser. :(
#include <math.h>
#include <stdio.h>
int main() {
long double a = nanl(0);
printf("%Lf\n", a);
return 0;
}