summaryrefslogtreecommitdiff
path: root/pp.c
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>2008-04-14 14:47:15 +0000
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2008-04-14 14:47:15 +0000
commit9d6bff35783dc768c5d72663e6e2d31769c5da91 (patch)
tree76675e6de1c3945b8f06b45b9400b9c7e240c5e8 /pp.c
parent523b30316ccbf7957aa8da41729ba68b3a5f47b5 (diff)
downloadperl-9d6bff35783dc768c5d72663e6e2d31769c5da91.tar.gz
Make atan2(0,0) return undef
p4raw-id: //depot/perl@33676
Diffstat (limited to 'pp.c')
-rw-r--r--pp.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/pp.c b/pp.c
index d940d104c1..145e74cd15 100644
--- a/pp.c
+++ b/pp.c
@@ -2798,7 +2798,10 @@ PP(pp_atan2)
dVAR; dSP; dTARGET; tryAMAGICbin(atan2,0);
{
dPOPTOPnnrl;
- SETn(Perl_atan2(left, right));
+ if (left == 0.0 && right == 0.0)
+ SETs(&PL_sv_undef);
+ else
+ SETn(Perl_atan2(left, right));
RETURN;
}
}