Codebase list libcryptx-perl / b749f00
fix #82 new t/mbi_ltm_big*.t failures Karel Miko 1 year, 8 months ago
4 changed file(s) with 41 addition(s) and 11 deletion(s). Raw diff Collapse all Expand all
554554 &bcos
555555 1.2:10:0.3623577545
556556 2.4:12:-0.737393715541
557 0:10:1
558 0:20:1
559557 1:10:0.5403023059
560558 1:12:0.540302305868
561559
840838 -2:-:-1
841839 -2:+:1
842840 2:-:-1
843 0::1
844 -2::1
845 abc::1
846 2:abc:1
847841
848842 &bsstr
849843 +inf:inf
66
77 BEGIN {
88 plan skip_all => "requires Math::BigFloat 1.999827+" unless eval { require Math::BigFloat && eval($Math::BigFloat::VERSION) >= 1.999827 };
9 plan tests => 2403 # tests in require'd file
9 plan tests => 2391 # tests in require'd file
1010 + 5; # tests in this file
1111 }
1212
1515
1616 BEGIN {
1717 plan skip_all => "requires Math::BigInt 1.9997+" unless eval { require Math::BigInt && eval($Math::BigInt::VERSION) >= 1.9997 };
18 plan tests => 71;
18 plan tests => 70;
1919 }
2020
2121 use Math::BigFloat only => 'LTM';
118118 is ($cl->new('1.2')->bpow('0.3',10), '1.056219968');
119119 is ($cl->new('10')->bpow('0.6',10), '3.981071706');
120120
121 # blog should handle bigint input
122 is (Math::BigFloat::blog(Math::BigInt->new(100),10), 2, "blog(100)");
123
124121 #############################################################################
125122 # some integer results
126123 is ($cl->new(2)->bpow(32)->blog(2), '32', "2 ** 32");
0 use strict;
1 use warnings;
2 use Test::More;
3
4 BEGIN {
5 plan skip_all => "requires Math::BigInt 1.999837+" unless eval { require Math::BigInt && eval($Math::BigInt::VERSION) >= 1.999837 };
6 plan tests => 3;
7 }
8
9 use Math::BigFloat only => 'LTM';
10 use Math::BigInt only => 'LTM';
11
12 my ($x, $y);
13
14 ### https://github.com/DCIT/perl-CryptX/issues/82
15
16 $x = Math::BigFloat->new("0");
17 $y = Math::BigFloat->new("20");
18 $x->bcos($y);
19 is($x, "1.0000000000000000000");
20 $x = Math::BigFloat->new("0");
21 $y = Math::BigFloat->new("20");
22 $x->bcos($y);
23 is($x, "1.0000000000000000000");
24 $x = Math::BigFloat->blog(Math::BigInt->new(100),10);
25 is($x, "2");
26
27 ### unsolved part of https://github.com/DCIT/perl-CryptX/issues/82
28 ## t/mbi_ltm_bigfltpm.t ................ 123/2408 Argument "" isn't numeric in subtraction (-) at /home/jkeenan/testing/v5.36.0/lib/perl5/site_perl/5.36.0/Math/BigFloat.pm line 4651, <DATA> line 330.
29 ## Argument "" isn't numeric in subtraction (-) at /home/jkeenan/testing/v5.36.0/lib/perl5/site_perl/5.36.0/Math/BigFloat.pm line 4651, <DATA> line 331.
30 ## Argument "" isn't numeric in subtraction (-) at /home/jkeenan/testing/v5.36.0/lib/perl5/site_perl/5.36.0/Math/BigFloat.pm line 4651, <DATA> line 332.
31 ## Argument "abc" isn't numeric in subtraction (-) at /home/jkeenan/testing/v5.36.0/lib/perl5/site_perl/5.36.0/Math/BigFloat.pm line 4651, <DATA> line 333.
32 #
33 #&bone
34 #...
35 #-0::1
36 #--2::1
37 #-abc::1
38 #-2:abc:1