From: Chris Williams Date: Thu, 10 Sep 2009 22:12:28 +0000 (+0100) Subject: Updated Math::BigRat to CPAN version 0.24 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=c6c613ed7cf301ecf7d4b5dcbf9642fa0fb63333;p=p5sagit%2Fp5-mst-13.2.git Updated Math::BigRat to CPAN version 0.24 --- diff --git a/Porting/Maintainers.pl b/Porting/Maintainers.pl index 1b7e656..a62f7c1 100755 --- a/Porting/Maintainers.pl +++ b/Porting/Maintainers.pl @@ -982,7 +982,7 @@ use File::Glob qw(:case); 'Math::BigRat' => { 'MAINTAINER' => 'tels', - 'DISTRIBUTION' => 'TELS/math/Math-BigRat-0.22.tar.gz', + 'DISTRIBUTION' => 'LETO/Math-BigRat-0.24.tar.gz', 'FILES' => q[ext/Math-BigRat], 'EXCLUDED' => [ qr{^inc/}, qw{ diff --git a/ext/Math-BigRat/lib/Math/BigRat.pm b/ext/Math-BigRat/lib/Math/BigRat.pm index 6d77f98..2460d1c 100644 --- a/ext/Math-BigRat/lib/Math/BigRat.pm +++ b/ext/Math-BigRat/lib/Math/BigRat.pm @@ -23,7 +23,8 @@ use vars qw($VERSION @ISA $upgrade $downgrade @ISA = qw(Math::BigFloat); -$VERSION = '0.22'; +$VERSION = '0.24'; +$VERSION = eval $VERSION; use overload; # inherit overload from Math::BigFloat @@ -279,7 +280,7 @@ sub new } # simple string input - if (($n =~ /[\.eE]/)) + if (($n =~ /[\.eE]/) && $n !~ /^0x/) { # looks like a float, quacks like a float, so probably is a float $self->{sign} = 'NaN'; @@ -1686,7 +1687,7 @@ use L or L instead. This routine is automatically used whenever a scalar is required: my $x = Math::BigRat->new('3/1'); - @array = (1,2,3); + @array = (0,1,2,3); $y = $array[$x]; # set $y to 3 =head2 as_int()/as_number() @@ -2012,6 +2013,8 @@ may contain more documentation and examples as well as testcases. =head1 AUTHORS -(C) by Tels L 2001 - 2008. +(C) by Tels L 2001 - 2009. + +Currently maintained by Jonathan "Duke" Leto L =cut diff --git a/ext/Math-BigRat/t/bigrat.t b/ext/Math-BigRat/t/bigrat.t index d898335..c7563e5 100644 --- a/ext/Math-BigRat/t/bigrat.t +++ b/ext/Math-BigRat/t/bigrat.t @@ -8,7 +8,7 @@ BEGIN $| = 1; chdir 't' if -d 't'; unshift @INC, '../lib'; # for running manually - plan tests => 198; + plan tests => 200; } # basic testing of Math::BigRat @@ -53,6 +53,8 @@ foreach my $func (qw/new bnorm/) $x = $cr->$func('-inf'); ok ($x,'-inf'); $x = $cr->$func('1/'); ok ($x,'NaN'); + $x = $cr->$func("0x7e"); ok($x, 126); + # input ala '1+1/3' isn't parsed ok yet $x = $cr->$func('1+1/3'); ok ($x,'NaN');