Good idea - thanks.
I eventually did find a way to simplify the math, and here's the test case I sent off:
#!perl
use strict;
use warnings;
use Test::More 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');
Note that by futzing with the
$lnev number, you can get this bug to disappear - for example, by changing the "7" to a "1".
--
@/=map{[/./g]}qw/.h_nJ Xapou cets krht ele_ r_ra/;
map{y/X_/\n /;print}map{pop@$_}@/for@/