Commit | Line | Data |
ee15d750 |
1 | #!/usr/bin/perl -w |
2 | |
dccbb853 |
3 | package Math::BigFloat::Subclass; |
ee15d750 |
4 | |
5 | require 5.005_02; |
6 | use strict; |
7 | |
8 | use Exporter; |
9 | use Math::BigFloat(1.23); |
dccbb853 |
10 | use vars qw($VERSION @ISA $PACKAGE |
ee15d750 |
11 | $accuracy $precision $round_mode $div_scale); |
12 | |
13 | @ISA = qw(Exporter Math::BigFloat); |
14 | |
ee15d750 |
15 | $VERSION = 0.01; |
16 | |
17 | # Globals |
18 | $accuracy = $precision = undef; |
19 | $round_mode = 'even'; |
20 | $div_scale = 40; |
21 | |
22 | sub new |
23 | { |
24 | my $proto = shift; |
25 | my $class = ref($proto) || $proto; |
26 | |
27 | my $value = shift || 0; # Set to 0 if not provided |
28 | my $decimal = shift; |
29 | my $radix = 0; |
30 | |
31 | # Store the floating point value |
32 | my $self = bless Math::BigFloat->new($value), $class; |
33 | $self->{'_custom'} = 1; # make sure this never goes away |
34 | return $self; |
35 | } |
36 | |
37 | 1; |