Re: [PATCH] 'make clobber' on Cygwin broken
[p5sagit/p5-mst-13.2.git] / t / lib / Math / BigFloat / Subclass.pm
CommitLineData
ee15d750 1#!/usr/bin/perl -w
2
dccbb853 3package Math::BigFloat::Subclass;
ee15d750 4
5require 5.005_02;
6use strict;
7
8use Exporter;
61f5c3f5 9use Math::BigFloat(1.27);
dccbb853 10use vars qw($VERSION @ISA $PACKAGE
ee15d750 11 $accuracy $precision $round_mode $div_scale);
12
13@ISA = qw(Exporter Math::BigFloat);
14
61f5c3f5 15$VERSION = 0.02;
ee15d750 16
17# Globals
18$accuracy = $precision = undef;
19$round_mode = 'even';
20$div_scale = 40;
21
22sub new
23{
24 my $proto = shift;
25 my $class = ref($proto) || $proto;
26
394e6ffb 27 my $value = shift;
61f5c3f5 28 my $a = $accuracy; $a = $_[0] if defined $_[0];
29 my $p = $precision; $p = $_[1] if defined $_[1];
ee15d750 30 # Store the floating point value
61f5c3f5 31 my $self = Math::BigFloat->new($value,$a,$p,$round_mode);
32 bless $self, $class;
ee15d750 33 $self->{'_custom'} = 1; # make sure this never goes away
34 return $self;
35}
36
371;