summaryrefslogtreecommitdiff
path: root/pp_ctl.c
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>2000-02-22 05:35:27 +0000
committerGurusamy Sarathy <gsar@cpan.org>2000-02-22 05:35:27 +0000
commitdbe7b1772b1a5593767d19db4bfee18f47979155 (patch)
tree9de24bd360cb02d14983d4910785a21a282b6287 /pp_ctl.c
parente541f5e7702d28bc5ed83b5b23cf57d476b829cb (diff)
downloadperl-dbe7b1772b1a5593767d19db4bfee18f47979155.tar.gz
adjust for lost fp precision in require version check
p4raw-id: //depot/perl@5190
Diffstat (limited to 'pp_ctl.c')
-rw-r--r--pp_ctl.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/pp_ctl.c b/pp_ctl.c
index 7c69e3526b..308c824b17 100644
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -2931,15 +2931,17 @@ PP(pp_require)
}
}
else if (!SvPOKp(sv)) { /* require 5.005_03 */
- NV n = SvNV(sv);
- rev = (UV)n;
- ver = (UV)((n-rev)*1000);
- sver = (UV)((((n-rev)*1000 - ver) + 0.0009) * 1000);
-
if ((NV)PERL_REVISION + ((NV)PERL_VERSION/(NV)1000)
+ ((NV)PERL_SUBVERSION/(NV)1000000)
+ 0.00000099 < SvNV(sv))
{
+ NV nrev = SvNV(sv);
+ UV rev = (UV)nrev;
+ NV nver = (nrev - rev) * 1000;
+ UV ver = (UV)(nver + 0.0009);
+ NV nsver = (nver - ver) * 1000;
+ UV sver = (UV)(nsver + 0.0009);
+
DIE(aTHX_ "Perl v%"UVuf".%"UVuf".%"UVuf" required--this is only version "
"v%d.%d.%d, stopped", rev, ver, sver, PERL_REVISION,
PERL_VERSION, PERL_SUBVERSION);