Change 16170 by jhi@alpha on 2002/04/25 22:13:02

        Subject: [PATCH] fix vos/vos.c to implement pow(0,0)
        From: [EMAIL PROTECTED]
        Date: Wed, 24 Apr 02 18:27 edt
        Message-Id: <[EMAIL PROTECTED]>

Affected files ...

.... //depot/perl/vos/vos.c#3 edit

Differences ...

==== //depot/perl/vos/vos.c#3 (text) ====
Index: perl/vos/vos.c
--- perl/vos/vos.c.~1~  Thu Apr 25 16:30:05 2002
+++ perl/vos/vos.c      Thu Apr 25 16:30:05 2002
@@ -2,6 +2,8 @@
 /* Written 02-01-02 by Nick Ing-Simmons ([EMAIL PROTECTED]) */
 /* Modified 02-03-27 by Paul Green ([EMAIL PROTECTED]) to
      add socketpair() dummy. */
+/* Modified 02-04-24 by Paul Green ([EMAIL PROTECTED]) to
+     have pow(0,0) return 1, avoiding c-1471. */
 /* End of modification history */
 
 #include <errno.h>
@@ -35,3 +37,22 @@
  errno = ENOSYS;
  return -1;
 }
+
+/* Supply a private version of the power function that returns 1
+   for x**0.  This avoids c-1471.  Abigail's Japh tests depend
+   on this fix.  We leave all the other cases to the VOS C
+   runtime.  */
+
+double s_crt_pow(double *x, double *y);
+
+double pow(x,y)
+double x, y;
+{
+     if (y == 0e0)                 /* c-1471 */
+     {
+          errno = EDOM;
+          return (1e0);
+     }
+
+     return(s_crt_pow(&x,&y));
+}
End of Patch.

Reply via email to