xref: /openbsd-src/gnu/usr.bin/perl/cpan/Math-BigInt/t/bigintc-import.t (revision 256a93a44f36679bee503f12e49566c2183f6181)
1*256a93a4Safresh1# -*- mode: perl; -*-
2*256a93a4Safresh1
3*256a93a4Safresh1use strict;
4*256a93a4Safresh1use warnings;
5*256a93a4Safresh1
6*256a93a4Safresh1use Test::More tests => 4;
7*256a93a4Safresh1
8*256a93a4Safresh1use Math::BigInt::Calc base_len => 1, use_int => 0;
9*256a93a4Safresh1
10*256a93a4Safresh1my ($BASE_LEN, $BASE, $AND_BITS, $XOR_BITS, $OR_BITS,
11*256a93a4Safresh1    $BASE_LEN_SMALL, $MAX_VAL,
12*256a93a4Safresh1    $MAX_BITS, $MAX_EXP_F, $MAX_EXP_I, $USE_INT)
13*256a93a4Safresh1  = Math::BigInt::Calc->_base_len();
14*256a93a4Safresh1
15*256a93a4Safresh1note(<<"EOF");
16*256a93a4Safresh1
17*256a93a4Safresh1BASE_LEN  = $BASE_LEN
18*256a93a4Safresh1BASE      = $BASE
19*256a93a4Safresh1MAX_VAL   = $MAX_VAL
20*256a93a4Safresh1AND_BITS  = $AND_BITS
21*256a93a4Safresh1XOR_BITS  = $XOR_BITS
22*256a93a4Safresh1OR_BITS   = $OR_BITS
23*256a93a4Safresh1MAX_EXP_F = $MAX_EXP_F
24*256a93a4Safresh1MAX_EXP_I = $MAX_EXP_I
25*256a93a4Safresh1USE_INT   = $USE_INT
26*256a93a4Safresh1EOF
27*256a93a4Safresh1
28*256a93a4Safresh1cmp_ok($BASE_LEN, "==", 1, '$BASE_LEN is 1');
29*256a93a4Safresh1cmp_ok($USE_INT,  "==", 0, '$USE_INT is 0');
30*256a93a4Safresh1
31*256a93a4Safresh1my $LIB = 'Math::BigInt::Calc';
32*256a93a4Safresh1
33*256a93a4Safresh1my $x = $LIB -> _new("31415926535897932384626433832");
34*256a93a4Safresh1my $str = $LIB -> _str($x);
35*256a93a4Safresh1is($str, "31415926535897932384626433832",
36*256a93a4Safresh1   "string representation of $LIB object");
37*256a93a4Safresh1
38*256a93a4Safresh1is("[ @$x ]", "[ 2 3 8 3 3 4 6 2 6 4 8 3 2 3 9 7 9 8 5 3 5 6 2 9 5 1 4 1 3 ]",
39*256a93a4Safresh1   "internal representation of $LIB object");
40