From: Jarkko Hietaniemi Date: Tue, 24 Apr 2001 03:16:13 +0000 (+0000) Subject: The Math::BigFloat::import() was broken. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=82cf049f3f1023d3b5aaa03aa981bafc5f0163c8;p=p5sagit%2Fp5-mst-13.2.git The Math::BigFloat::import() was broken. (Fixes bug id 20010422.002.) p4raw-id: //depot/perl@9809 --- diff --git a/lib/Math/BigFloat.pm b/lib/Math/BigFloat.pm index ff8aea5..edde97a 100644 --- a/lib/Math/BigFloat.pm +++ b/lib/Math/BigFloat.pm @@ -68,7 +68,15 @@ sub stringify { sub import { shift; return unless @_; - die "unknown import: @_" unless @_ == 1 and $_[0] eq ':constant'; + if (@_ == 1 && $_[0] ne ':constant') { + if ($_[0] > 0) { + if ($VERSION < $_[0]) { + die __PACKAGE__.": $_[0] required--this is only version $VERSION"; + } + } else { + die __PACKAGE__.": unknown import: $_[0]"; + } + } overload::constant float => sub {Math::BigFloat->new(shift)}; }