lib/bigintpl.t See if bigint.pl works
lib/bigint.pm bignum
lib/bignum.pm bignum
+lib/bignum/t/bigexp.t See if bignum works
lib/bignum/t/bigint.t See if bigint works
lib/bignum/t/bignum.t See if bignum works
lib/bignum/t/bigrat.t See if bigrat works
@ISA = qw(Math::BigFloat);
-$VERSION = '0.17';
+$VERSION = '0.18';
use overload; # inherit overload from Math::BigFloat
package bignum;
use 5.006002;
-$VERSION = '0.19';
+$VERSION = '0.20';
use Exporter;
@EXPORT_OK = qw( );
@EXPORT = qw( inf NaN );
perl -Mbignum -le 'print 3/7 + 5/7 + 8/3'
perl -Mbignum -le 'print 123->is_odd()'
perl -Mbignum -le 'print log(2)'
+ perl -Mbignum -le 'print exp(1)'
perl -Mbignum -le 'print 2 ** 0.5'
perl -Mbignum=a,65 -le 'print 2 ** 0.2'
perl -Mbignum=a,65,l,GMP -le 'print 7 ** 7777'
--- /dev/null
+#!/usr/bin/perl -w
+
+###############################################################################
+# test for bug #18025: bignum/bigrat can lead to a number that is both 1 and 0
+
+use Test::More;
+use strict;
+
+BEGIN
+ {
+ $| = 1;
+ chdir 't' if -d 't';
+ unshift @INC, '../lib';
+ plan tests => 4;
+ }
+
+use bignum;
+
+my $lnev = -7 / (10**17);
+my $ev=exp($lnev);
+
+is( sprintf('%0.5f',$ev) , '1.00000', '($ev) is approx. 1' );
+is( sprintf('%0.5f',1-$ev) , '0.00000', '(1-$ev) is approx. 0' );
+is( sprintf('%0.5f',1-"$ev") , '0.00000', '(1-"$ev") is approx. 0' );
+
+cmp_ok( $ev, '!=', 0, '$ev should not equal 0');