Sponsored Content
Top Forums Shell Programming and Scripting 2 versions, 1 script (A tale of madness.) Post 302514408 by mrwatkin on Friday 15th of April 2011 03:41:04 PM
Old 04-15-2011
Quote:
Originally Posted by Perderabo
My perl pocket reference says that "use" has an optional version. So I guess that something like:use Math::BigInt 1.87; might work.
I tried it yesterday and it didn't work. Thanks for the reply though. I appreciate it.
 

7 More Discussions You Might Find Interesting

1. IP Networking

network madness

well here's the situation .... the setup - cisco 800 series router , 2 cisco 1900 switches , which connect abt 15 pc's . the task - establish a connection with a remote server through a digital line (64kbps) the problem - 7 pcs connected to one of the two switches do not connect to the... (9 Replies)
Discussion started by: cubicle^dweller
9 Replies

2. IP Networking

network speed not tale with the port setting

Hi all, one of my Sun Box facing the problem. The network port i had set to Auto-Negotiated and i had edited the /etc/system/ file in the Sun box as below: set hme:hme_adv_autoneg_cap=1 set hme:hme_adv_100fdx_cap=0 set hme:hme_adv_100hdx_cap=0 But when i checked the /var/adm/messages/, it... (0 Replies)
Discussion started by: AirWalker83
0 Replies

3. Shell Programming and Scripting

shell script preserving last 2 versions of files

I need some help with the logic and syntax for a shell script (ksh) that will search a directory and look for similar files and save only the last two versions. The version number is in the file name. However, the files are of varying name lengths and may have 1 or many files, with no limit to... (6 Replies)
Discussion started by: synergy_texas
6 Replies

4. Shell Programming and Scripting

Need a script to delete previous versions of files

Hi. I need a script (either bash or perl) that can delete previous versions of files. For instance, from our continuous build process I get directories such as build5_dev_1.21 build5_dev_1.22 build5_dev_1.23 build5_dev_1.24 I need a script that I can run every night (using "at"... (6 Replies)
Discussion started by: jbsimon000
6 Replies

5. Shell Programming and Scripting

Script to delete older versions of unique files

I have directory where new sub directories and files being created every few minutes. The directories are like abc_date, def_date, ghi_date. I am looking to keep the latest 2 unique directories and delete everything else. Here is what I have so far This gives me unique names excluding the... (5 Replies)
Discussion started by: zzstore
5 Replies

6. What is on Your Mind?

Interview madness

A discussion elsewhere got me thinking: What where the most insane/amusing/strange interview questions or answers you got/gave? Not overly technical stuff, but questions that made you go "Huh?" (And keeping with this forums main Idea: "No technical Q&A") I'll start... (6 Replies)
Discussion started by: pludi
6 Replies

7. Shell Programming and Scripting

Script to maintain file versions

I am developing a script to maintain 'n' number of versions of a file. The script will take a filename as a parameter and the number of versions to maintain. This basically does something like a FIFO. Here is what I developed. But something is not right. I have attached the script. Can u pls help... (2 Replies)
Discussion started by: vskr72
2 Replies
Math::GMP(3pm)						User Contributed Perl Documentation					    Math::GMP(3pm)

NAME
Math::GMP - High speed arbitrary size integer math SYNOPSIS
use Math::GMP; my $n = new Math::GMP 2; $n = $n ** (256*1024); $n = $n - 1; print "n is now $n "; DESCRIPTION
Math::GMP was designed to be a drop-in replacement both for Math::BigInt and for regular integer arithmetic. Unlike BigInt, though, Math::GMP uses the GNU gmp library for all of its calculations, as opposed to straight Perl functions. This can result in speed improvements. The downside is that this module requires a C compiler to install -- a small tradeoff in most cases. Also, this module is not 100% compatible to Math::BigInt. A Math::GMP object can be used just as a normal numeric scalar would be -- the module overloads most of the normal arithmetic operators to provide as seamless an interface as possible. However, if you need a perfect interface, you can do the following: use Math::GMP qw(:constant); $n = 2 ** (256 * 1024); print "n is $n "; This would fail without the ':constant' since Perl would use normal doubles to compute the 250,000 bit number, and thereby overflow it into meaninglessness (smaller exponents yield less accurate data due to floating point rounding). METHODS
Although the non-overload interface is not complete, the following functions do exist: new $x = Math::GMP->new(123); Creates a new Math::GMP object from the passed string or scalar. $x = Math::GMP->new('abcd', 36); Creates a new Math::GMP object from the first parameter which should be represented in the base specified by the second parameter. bfac $x = Math::GMP->new(5); $x->bfac(); # 1*2*3*4*5 = 120 Calculates the factorial of $x and modifies $x to contain the result. band $x = Math::GMP->new(6); $x->band(3); # 0b110 & 0b11 = 1 Calculates the bit-wise AND of it's two arguments and modifies the first argument. bxor $x = Math::GMP->new(6); $x->bxor(3); # 0b110 & 0b11 = 0b101 Calculates the bit-wise XOR of it's two arguments and modifies the first argument. bior $x = Math::GMP->new(6); $x->bior(3); # 0b110 & 0b11 = 0b111 Calculates the bit-wise OR of it's two arguments and modifies the first argument. bgcd $x = Math::GMP->new(6); $x->bgcd(4); # 6 / 2 = 2, 4 / 2 = 2 => 2 Calculates the Greatest Common Divisior of it's two arguments and returns the result. legendre jacobi fibonacci $x = Math::GMP->fibonacci(16); Calculates the n'th number in the Fibonacci sequence. probab_prime $x = Math::GMP->new(7); $x->probab_prime(10); Probabilistically Determines if the number is a prime. Argument is the number of checks to perform. Returns 0 if the number is definitely not a prime, 1 if it may be, and 2 if it is definitely is a prime. BUGS
As of version 1.0, Math::GMP is mostly compatible with the old Math::BigInt version. It is not a full replacement for the rewritten Math::BigInt versions, though. See the SEE ALSO section on how to achieve to use Math::GMP and retain full compatibility to Math::BigInt. There are some slight incompatibilities, such as output of positive numbers not being prefixed by a '+' sign. This is intentional. There are also some things missing, and not everything might work as expected. SEE ALSO
Math::BigInt has a new interface to use a different library than the default pure Perl implementation. You can use, for instance, Math::GMP with it: use Math::BigInt lib => 'GMP'; If Math::GMP is not installed, it will fall back to it's own Perl implementation. See Math::BigInt and Math::BigInt::GMP or Math::BigInt::Pari or Math::BigInt::BitVect. AUTHOR
Chip Turner <chip@redhat.com>, based on the old Math::BigInt by Mark Biggar and Ilya Zakharevich. Further extensive work provided by Tels <tels@bloodgate.com>. perl v5.14.2 2009-09-17 Math::GMP(3pm)
All times are GMT -4. The time now is 10:18 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy