Anyone have any ideas why? I was hoping to use it as an example in my datetime talk at YAPC but oh well.

Dave, I seem to have found it. DT::Util::Calc's mod() function behaves oddly when using $bigint->bmod($mod).

Can you confirm that this will fix your problems?

Index: lib/DateTime/Util/Calc.pm
===================================================================
RCS file: /cvsroot/perl-date-time/modules/DateTime-Util-Calc/lib/DateTime/Util/Calc.pm,v
retrieving revision 1.15
diff -d -u -r1.15 Calc.pm
--- lib/DateTime/Util/Calc.pm   7 Jan 2005 12:31:50 -0000       1.15
+++ lib/DateTime/Util/Calc.pm   27 Jun 2005 22:17:28 -0000
@@ -17,7 +17,7 @@
 use vars qw($DOWNGRADE_ACCURACY);
 BEGIN
 {
-    $VERSION = '0.08';
+    $VERSION = '0.09';
     @ISA = qw(Exporter);
     @EXPORT_OK = qw(
         binary_search
@@ -113,7 +113,7 @@
     my $num = bigint(shift);
     my $mod = shift;

-    return $num->bmod($mod);
+    return $num % $mod;
 }

 sub amod



--d


Reply via email to