The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

my $num = '10000000000000000001'; my @try = ($num, Math::BigInt->new($num)); push @try, Math::Pari->new($num) if $has_pari; for my $try (@try) { my $type = 'any2bigint(' . (ref($try) || 'scalar') . ')'; my $val = Crypt::DH::_any2bigint($try); ok($val, $type . ' returns a defined value'); is(ref($val), 'Math::BigInt', $type . ' returns a Math::BigInt'); is($val->bstr, $num, $type . ' returns the correct value'); }