This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Upgrade Math::BigInt from 1.999701 to 1.999704
[perl5.git] / cpan / Math-BigInt / t / bigfltpm.t
CommitLineData
58cde26e 1#!/usr/bin/perl -w
5d7098d5 2
58cde26e 3use strict;
06ce15ad 4use Test::More tests => 2360
3167abe5 5 + 5; # own tests
58cde26e 6
5d7098d5 7
233f7bc0 8use Math::BigInt lib => 'Calc';
574bacfe 9use Math::BigFloat;
5d7098d5 10
b3abae2a 11use vars qw ($class $try $x $y $f @args $ans $ans1 $ans1_str $setup $CL);
ee15d750 12$class = "Math::BigFloat";
b3abae2a 13$CL = "Math::BigInt::Calc";
8f675a64 14
3167abe5
NC
15is ($class->config()->{class},$class);
16is ($class->config()->{with}, $CL);
a0ac753d
T
17
18# bug #17447: Can't call method Math::BigFloat->bsub, not a valid method
86b76201 19my $c = Math::BigFloat->new( '123.3' );
3167abe5 20is ($c->fsub(123), '0.3'); # calling fsub on a BigFloat works
86b76201
T
21
22# Bug until BigInt v1.86, the scale wasn't treated as a scalar:
23$c = Math::BigFloat->new('0.008'); my $d = Math::BigFloat->new(3);
24my $e = $c->bdiv(Math::BigFloat->new(3),$d);
25
3167abe5 26is ($e,'0.00267'); # '0.008 / 3 => 0.0027');
06ce15ad
SH
27
28SKIP: {
29 skip("skipping test which is not for this backend", 1)
30 unless $CL eq 'Math::BigInt::Calc';
31 is (ref($e->{_e}->[0]), ''); # 'Not a BigInt');
32}
86b76201 33
4aa37faf 34require 't/bigfltpm.inc'; # all tests here for sharing