From: Rafael Garcia-Suarez <rgarciasuarez@gmail.com>
Date: Mon, 14 Apr 2008 15:16:08 +0000 (+0000)
Subject: Revert change #33676, likely to break atan(-0,0) on some platforms
X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=a1021d57870f2cf967a704182b47a5defa79a0f1;p=p5sagit%2Fp5-mst-13.2.git

Revert change #33676, likely to break atan(-0,0) on some platforms
p4raw-link: @33676 on //depot/perl: 9d6bff35783dc768c5d72663e6e2d31769c5da91

p4raw-id: //depot/perl@33678
---

diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod
index f17311a..6af9f8d 100644
--- a/pod/perlfunc.pod
+++ b/pod/perlfunc.pod
@@ -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
--- 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;
     }
 }
diff --git a/t/op/exp.t b/t/op/exp.t
index c49a34b..9bc44b4 100755
--- a/t/op/exp.t
+++ b/t/op/exp.t
@@ -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');