summaryrefslogtreecommitdiff
path: root/vos
diff options
context:
space:
mode:
authorPaul Green <Paul.Green@stratus.com>2002-04-24 14:27:00 -0400
committerJarkko Hietaniemi <jhi@iki.fi>2002-04-25 22:13:02 +0000
commit0ee4199b072f968bf13b9bf322c9b3c37169dc98 (patch)
tree8c8c878c29ca056e229672dc58408a2bc024024b /vos
parentba861905bdee73ea63a48b2807a88806619d76c7 (diff)
downloadperl-0ee4199b072f968bf13b9bf322c9b3c37169dc98.tar.gz
fix vos/vos.c to implement pow(0,0)
Message-Id: <200204242252.SAA07978@mailhub1.stratus.com> p4raw-id: //depot/perl@16170
Diffstat (limited to 'vos')
-rw-r--r--vos/vos.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/vos/vos.c b/vos/vos.c
index a72614c3f3..9876d705b4 100644
--- a/vos/vos.c
+++ b/vos/vos.c
@@ -2,6 +2,8 @@
/* Written 02-01-02 by Nick Ing-Simmons (nick@ing-simmons.net) */
/* Modified 02-03-27 by Paul Green (Paul.Green@stratus.com) to
add socketpair() dummy. */
+/* Modified 02-04-24 by Paul Green (Paul.Green@stratus.com) to
+ have pow(0,0) return 1, avoiding c-1471. */
/* End of modification history */
#include <errno.h>
@@ -35,3 +37,22 @@ socketpair (int family, int type, int protocol, int fd[2]) {
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));
+}