develooper Front page | perl.perl5.porters | Postings from January 2001

[PATCH: perl@8429] lib/tie-substrhash.t FAILED at test 11

From:
Roca, Ignasi
Date:
January 17, 2001 06:19
Subject:
[PATCH: perl@8429] lib/tie-substrhash.t FAILED at test 11
Message ID:
5930DC161690D2119667009027157547038C8A85@madt009a.siemens.es
There is a bug in pp_int() function that has a bad influence in the wrap
method of Tie::Substrhash

Try following perl-script:

$t0 = 279964589018079;

$t1 = int($t0 / 59);
print "int($t0/59)=$t1\n";

The result is 
int(279964589018079/59)=4745162525730.15

As you can see result is not an integer.

Following is a patch to correct the bug
===============================================
--- pp.c.orig   Tue Jan  9 05:14:45 2001
+++ pp.c        Wed Jan 17 15:10:30 2001
@@ -2593,6 +2593,7 @@
                  (void)Perl_modf(tmp, &tmp);
                  value = (NV)tmp;
 #endif
+                 SETn(value);
              }
          }
          else {
===============================================

-- Ignasi Roca



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About