2001-03-06 03:17:54 -05:00
|
|
|
/* public domain rewrite of isnan(3) */
|
|
|
|
|
2010-07-28 04:12:01 -04:00
|
|
|
#include "ruby/missing.h"
|
|
|
|
|
2005-10-21 21:28:00 -04:00
|
|
|
static int double_ne(double n1, double n2);
|
1999-08-13 01:45:20 -04:00
|
|
|
|
|
|
|
int
|
2005-10-21 21:28:00 -04:00
|
|
|
isnan(double n)
|
1999-08-13 01:45:20 -04:00
|
|
|
{
|
2003-12-20 10:45:15 -05:00
|
|
|
return double_ne(n, n);
|
1999-08-13 01:45:20 -04:00
|
|
|
}
|
|
|
|
|
2003-12-20 10:45:15 -05:00
|
|
|
static int
|
2005-10-21 21:28:00 -04:00
|
|
|
double_ne(double n1, double n2)
|
1999-08-13 01:45:20 -04:00
|
|
|
{
|
2003-12-20 10:45:15 -05:00
|
|
|
return n1 != n2;
|
1999-08-13 01:45:20 -04:00
|
|
|
}
|