Many thanks, Sisyphus. I didn't think to look at and use the Math::BigInt
package in conjunction with Math::BigFloat.

Cheers

Geoff

-----Original Message-----
From: Sisyphus [mailto:sisyph...@optusnet.com.au] 
Sent: 02 July 2014 02:53
To: Geoff Horsnell; perl-win32-users@listserv.activestate.com
Subject: Re: Request for more functionality in Math::BigFloat


----- Original Message ----- 
From: "Geoff Horsnell" <ge...@horsnell.freeserve.co.uk>
To: <perl-win32-users@listserv.activestate.com>
Sent: Wednesday, July 02, 2014 12:34 AM
Subject: Request for more functionality in Math::BigFloat


> Has anyone extended the Math::BigFloat package to include such niceties as
> the INT function, or remaindering? I need to be able to do some large
> calculations and those two functions would be very useful additions to the
> Math::BigFloat package

I think the functionality you seek is already there:

#############################
#!perl -l

use strict;
use warnings;
use Math::BigFloat;
use Math::BigInt;

my $str = ('987' x 12) . '.123';

my $f = Math::BigFloat->new($str);
print $f;
print int($f);

my $i = Math::BigInt->new('654' x 12);

print $i;
print $i % 1000;

__END__
Outputs:
987987987987987987987987987987987987.123
987987987987987987987987987987987987
654654654654654654654654654654654654
654
#############################

Cheers,
Rob 

_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to