# Test blog function (and bpow, since it uses blog).
# It is too slow to be simple included in bigfltpm.inc, where it would get
# executed 3 times. One time would be under BareCalc, which shouldn't make any
# difference since there is no CALC->_log() function, and one time under a
# subclass, which *should* work.
# But it is better to test the numerical functionality, instead of not testing
# it at all (which did lead to wrong answers for 0 < $x < 1 in blog() in
# versions up to v1.63, and for bsqrt($x) when $x << 1 for instance).
use Test;
use strict;
{
$| = 1;
# to locate the testing files
{
# testing with the core distribution
}
if (-d 't')
{
chdir 't';
}
else
{
}
print "# INC = @INC\n";
}
my $cl = "Math::BigFloat";
# These tests are now really fast, since they collapse to blog(10), basically
# Don't attempt to run them with older versions. You are warned.
# $x < 0 => NaN
# 10 is cached (up to 75 digits)
# 0.1 is using the cached value for log(10), too
# also cached
# These are still slow, so do them only to 10 digits
# blog should handle bigint input
# some integer results
# test for bug in bsqrt() not taking negative _e into account
sub test_bpow
{
print "# Tried: $x->bpow($y,$scale);\n"
}