#!/usr/bin/perl -w
BEGIN
{
$| = 1;
my
$location
= $0;
$location
=~ s/constant.t//i;
if
(
$ENV
{PERL_CORE})
{
@INC
=
qw(../t/lib)
;
}
unshift
@INC
,
qw(../lib)
;
if
(-d
't'
)
{
chdir
't'
;
unshift
@INC
, File::Spec->catdir(File::Spec->updir,
$location
);
}
else
{
unshift
@INC
,
$location
;
}
print
"# INC = @INC\n"
;
plan
tests
=> 7;
if
($] < 5.006)
{
for
(1..7) { skip (1,
'Not supported on older Perls'
); }
exit
;
}
}
ok (2 ** 255,
'57896044618658097711785492504343953926634992332820282019728792003956564819968'
);
{
no
warnings
'portable'
;
ok (0x123456789012345678901234567890,
Math::BigInt->new(
'0x123456789012345678901234567890'
));
ok (0b01010100011001010110110001110011010010010110000101101101,
Math::BigInt->new(
'0b01010100011001010110110001110011010010010110000101101101'
));
}
ok (1.0 / 3.0,
'0.3333333333333333333333333333333333333333'
);
Math::BigFloat->
import
(
qw/:constant/
);
ok (1,1);
Math::BigFloat->
import
(
qw/:constant upgrade Math::BigRat/
);
ok (1,1);
Math::BigFloat->
import
(
qw/upgrade Math::BigRat :constant/
);
ok (1,1);