summaryrefslogtreecommitdiff
path: root/pp.c
diff options
context:
space:
mode:
authorDaniel Dragan <bulk88@hotmail.com>2014-10-07 01:44:44 -0400
committerSteve Hay <steve.m.hay@googlemail.com>2014-10-07 07:59:40 +0100
commita3463d96fc98ef9fd9615e36862cda5b810558e6 (patch)
tree25b9ef7fe39e74a9b09fd5e38a50ac8f82c7cd57 /pp.c
parentea06156217bce6b0cb71e6b0aebf6fd3cbe7a721 (diff)
downloadperl-a3463d96fc98ef9fd9615e36862cda5b810558e6.tar.gz
fix op/infnan.t failures on VC 6
fixes 2 failures, first is a fatal error, sceond is a not ok ----- ok 460 - abs(NaN) is NaN ok 461 - int(NaN) is NaN Can't take sqrt of NaN at op/infnan.t line 319. C:\perl521\srcvc6\t> ----- ok 465 - sin(NaN) is NaN not ok 466 - rand(NaN) is NaN # Failed test 466 - rand(NaN) is NaN at op/infnan.t line 331 # got "0.20653527722801" # expected "NaN" ok 467 - sin(9**9**9) is NaN -----
Diffstat (limited to 'pp.c')
-rw-r--r--pp.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/pp.c b/pp.c
index 58169cb679..c14eb3ab59 100644
--- a/pp.c
+++ b/pp.c
@@ -2717,7 +2717,11 @@ PP(pp_sin)
const NV value = SvNV_nomg(arg);
NV result = NV_NAN;
if (neg_report) { /* log or sqrt */
- if (op_type == OP_LOG ? (value <= 0.0) : (value < 0.0)) {
+ if (
+#if defined(NAN_COMPARE_BROKEN) && defined(Perl_isnan)
+ ! Perl_isnan(value) &&
+#endif
+ (op_type == OP_LOG ? (value <= 0.0) : (value < 0.0))) {
SET_NUMERIC_STANDARD();
/* diag_listed_as: Can't take log of %g */
DIE(aTHX_ "Can't take %s of %"NVgf, neg_report, value);
@@ -2768,7 +2772,11 @@ PP(pp_rand)
value = SvNV(sv);
}
/* 1 of 2 things can be carried through SvNV, SP or TARG, SP was carried */
+#if defined(NAN_COMPARE_BROKEN) && defined(Perl_isnan)
+ if (! Perl_isnan(value) && value == 0.0)
+#else
if (value == 0.0)
+#endif
value = 1.0;
{
dTARGET;