Change 33678 by [EMAIL PROTECTED] on 2008/04/14 15:16:08

        Revert change #33676, likely to break atan(-0,0) on some platforms

Affected files ...

... //depot/perl/pod/perlfunc.pod#597 edit
... //depot/perl/pp.c#628 edit
... //depot/perl/t/op/exp.t#11 edit

Differences ...

==== //depot/perl/pod/perlfunc.pod#597 (text) ====
Index: perl/pod/perlfunc.pod
--- perl/pod/perlfunc.pod#596~33676~    2008-04-14 07:47:15.000000000 -0700
+++ perl/pod/perlfunc.pod       2008-04-14 08:16:08.000000000 -0700
@@ -492,7 +492,8 @@
 
     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>

==== //depot/perl/pp.c#628 (text) ====
Index: perl/pp.c
--- perl/pp.c#627~33676~        2008-04-14 07:47:15.000000000 -0700
+++ perl/pp.c   2008-04-14 08:16:08.000000000 -0700
@@ -2798,10 +2798,7 @@
     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;
     }
 }

==== //depot/perl/t/op/exp.t#11 (xtext) ====
Index: perl/t/op/exp.t
--- perl/t/op/exp.t#10~33676~   2008-04-14 07:47:15.000000000 -0700
+++ perl/t/op/exp.t     2008-04-14 08:16:08.000000000 -0700
@@ -6,7 +6,7 @@
     require './test.pl';
 }
 
-plan tests => 17;
+plan tests => 16;
 
 # compile time evaluation
 
@@ -57,7 +57,3 @@
 # 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');
End of Patch.

Reply via email to