Revert change #33676, likely to break atan(-0,0) on some platforms
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>
Mon, 14 Apr 2008 15:16:08 +0000 (15:16 +0000)
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>
Mon, 14 Apr 2008 15:16:08 +0000 (15:16 +0000)
p4raw-link: @33676 on //depot/perl: 9d6bff35783dc768c5d72663e6e2d31769c5da91

p4raw-id: //depot/perl@33678

pod/perlfunc.pod
pp.c
t/op/exp.t

index f17311a..6af9f8d 100644 (file)
@@ -492,7 +492,8 @@ function, or use the familiar relation:
 
     sub tan { sin($_[0]) / cos($_[0])  }
 
-Perl returns C<undef> for C<atan(0,0)>.
+The return value for C<atan2(0,0)> is implementation-defined; consult
+your atan2(3) manpage for more information.
 
 =item bind SOCKET,NAME
 X<bind>
diff --git a/pp.c b/pp.c
index 145e74c..d940d10 100644 (file)
--- a/pp.c
+++ b/pp.c
@@ -2798,10 +2798,7 @@ PP(pp_atan2)
     dVAR; dSP; dTARGET; tryAMAGICbin(atan2,0);
     {
       dPOPTOPnnrl;
-      if (left == 0.0 && right == 0.0)
-         SETs(&PL_sv_undef);
-      else
-         SETn(Perl_atan2(left, right));
+      SETn(Perl_atan2(left, right));
       RETURN;
     }
 }
index c49a34b..9bc44b4 100755 (executable)
@@ -6,7 +6,7 @@ BEGIN {
     require './test.pl';
 }
 
-plan tests => 17;
+plan tests => 16;
 
 # compile time evaluation
 
@@ -57,7 +57,3 @@ cmp_ok(round(cos(-1 * $pi_2)), '==', 0.0);
 # atan2() tests were removed due to differing results from calls to
 # atan2() on various OS's and architectures.  See perlport.pod for
 # more information.
-
-# Just test that atan2(0,0) is undef, because that's implemented
-# from within perl.
-ok(!defined(atan2(0,0)), 'atan2(0,0) returns undef');