| Store | Cart

RE: Request for more functionality in Math::BigFloat

From: Geoff Horsnell <geo...@horsnell.freeserve.co.uk>
Wed, 2 Jul 2014 06:51:08 +0100
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:sisy...@optusnet.com.au] 
Sent: 02 July 2014 02:53
To: Geoff Horsnell; perl...@listserv.activestate.com
Subject: Re: Request for more functionality in Math::BigFloat


----- Original Message ----- 
From: "Geoff Horsnell" <geo...@horsnell.freeserve.co.uk>
To: <perl...@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...@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Recent Messages in this Thread
Geoff Horsnell Jul 01, 2014 02:34 pm
Sisyphus Jul 02, 2014 01:53 am
Geoff Horsnell Jul 02, 2014 05:51 am
Messages in this thread