BSD 4_3 release
[unix-history] / usr / src / usr.lib / libm / jn.c
index 690d88e..27c9be0 100644 (file)
@@ -1,4 +1,6 @@
-/*     @(#)jn.c        4.1     12/25/82        */
+#ifndef lint
+static char sccsid[] = "@(#)jn.c       4.2 (Berkeley) 8/21/85";
+#endif not lint
 
 /*
        floating point Bessel's function of
 
 /*
        floating point Bessel's function of
 */
 
 #include <math.h>
 */
 
 #include <math.h>
+#ifdef VAX
 #include <errno.h>
 #include <errno.h>
-
-int    errno;
+#else  /* IEEE double */
+static double zero = 0.e0;
+#endif
 
 double
 jn(n,x) int n; double x;{
 
 double
 jn(n,x) int n; double x;{
@@ -87,8 +91,12 @@ yn(n,x) int n; double x;{
        double y0(), y1();
 
        if (x <= 0) {
        double y0(), y1();
 
        if (x <= 0) {
-               errno = EDOM;
-               return(-HUGE);
+#ifdef VAX
+               extern double infnan();
+               return(infnan(EDOM));   /* NaN */
+#else  /* IEEE double */
+               return(zero/zero);      /* IEEE machines: invalid operation */
+#endif
        }
        sign = 1;
        if(n<0){
        }
        sign = 1;
        if(n<0){