This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Upgrade to Math::BigInt 1.44 from Tels and
[perl5.git] / lib / Math / BigInt / t / Math / Subclass.pm
1 #!/usr/bin/perl -w
2
3 package Math::Subclass;
4
5 require 5.005_02;
6 use strict;
7
8 use Exporter;
9 use Math::BigFloat(1.23);
10 use vars qw($VERSION @ISA @EXPORT
11             @EXPORT_OK %EXPORT_TAGS $PACKAGE
12             $accuracy $precision $round_mode $div_scale);
13
14 @ISA = qw(Exporter Math::BigFloat);
15
16 %EXPORT_TAGS = ( 'all' => [ qw(
17 ) ] );
18
19 @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );
20
21 @EXPORT = qw(
22 );
23 $VERSION = 0.01;
24
25 # Globals
26 $accuracy = $precision = undef;
27 $round_mode = 'even';
28 $div_scale = 40;
29
30 sub new
31 {
32         my $proto  = shift;
33         my $class  = ref($proto) || $proto;
34
35         my $value       = shift || 0;   # Set to 0 if not provided
36         my $decimal     = shift;
37         my $radix       = 0;
38
39         # Store the floating point value
40         my $self = bless Math::BigFloat->new($value), $class;
41         $self->{'_custom'} = 1; # make sure this never goes away
42         return $self;
43 }
44
45 1;