Re: BigInt bug with non-integer accuracy/precision
[p5sagit/p5-mst-13.2.git] / lib / Math / BigRat.pm
index a2f0796..9e2e62d 100644 (file)
@@ -14,7 +14,7 @@
 package Math::BigRat;
 
 # anythig older is untested, and unlikely to work
-use 5.006002;
+use 5.006;
 use strict;
 
 use Math::BigFloat;
@@ -23,7 +23,7 @@ use vars qw($VERSION @ISA $upgrade $downgrade
 
 @ISA = qw(Math::BigFloat);
 
-$VERSION = '0.20';
+$VERSION = '0.21';
 
 use overload;                  # inherit overload from Math::BigFloat
 
@@ -1409,7 +1409,8 @@ sub as_number
   {
   my ($self,$x) = ref($_[0]) ? (undef,$_[0]) : objectify(1,@_);
 
-  return Math::BigInt->new($x) if $x->{sign} !~ /^[+-]$/;      # NaN, inf etc
+  # NaN, inf etc
+  return Math::BigInt->new($x->{sign}) if $x->{sign} !~ /^[+-]$/;
  
   my $u = Math::BigInt->bzero();
   $u->{sign} = $x->{sign};