Sponsored Content
Top Forums Shell Programming and Scripting 2 versions, 1 script (A tale of madness.) Post 302514292 by Perderabo on Friday 15th of April 2011 10:42:34 AM
Old 04-15-2011
My perl pocket reference says that "use" has an optional version. So I guess that something like:use Math::BigInt 1.87; might work.
 

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::BigRat(3pm)					 Perl Programmers Reference Guide					 Math::BigRat(3pm)

NAME
Math::BigRat - arbitrarily big rationales SYNOPSIS
use Math::BigRat; $x = Math::BigRat->new('3/7'); $x += '5/9'; print $x->bstr()," "; print $x ** 2," "; DESCRIPTION
Math::BigRat complements Math::BigInt and Math::BigFloat by providing support for arbitrarily big rationales. MATH LIBRARY Math with the numbers is done (by default) by a module called Math::BigInt::Calc. This is equivalent to saying: use Math::BigRat lib => 'Calc'; You can change this by using: use Math::BigRat lib => 'BitVect'; The following would first try to find Math::BigInt::Foo, then Math::BigInt::Bar, and when this also fails, revert to Math::BigInt::Calc: use Math::BigRat lib => 'Foo,Math::BigInt::Bar'; Calc.pm uses as internal format an array of elements of some decimal base (usually 1e7, but this might be different for some systems) with the least significant digit first, while BitVect.pm uses a bit vector of base 2, most significant bit first. Other modules might use even different means of representing the numbers. See the respective module documentation for further details. Currently the following replacement libraries exist, search for them at CPAN: Math::BigInt::BitVect Math::BigInt::GMP Math::BigInt::Pari Math::BigInt::FastCalc METHODS
Any methods not listed here are dervied from Math::BigFloat (or Math::BigInt), so make sure you check these two modules for further infor- mation. new() $x = Math::BigRat->new('1/3'); Create a new Math::BigRat object. Input can come in various forms: $x = Math::BigRat->new(123); # scalars $x = Math::BigRat->new('123.3'); # float $x = Math::BigRat->new('1/3'); # simple string $x = Math::BigRat->new('1 / 3'); # spaced $x = Math::BigRat->new('1 / 0.1'); # w/ floats $x = Math::BigRat->new(Math::BigInt->new(3)); # BigInt $x = Math::BigRat->new(Math::BigFloat->new('3.1')); # BigFloat $x = Math::BigRat->new(Math::BigInt::Lite->new('2')); # BigLite numerator() $n = $x->numerator(); Returns a copy of the numerator (the part above the line) as signed BigInt. denominator() $d = $x->denominator(); Returns a copy of the denominator (the part under the line) as positive BigInt. parts() ($n,$d) = $x->parts(); Return a list consisting of (signed) numerator and (unsigned) denominator as BigInts. as_number() $x = Math::BigRat->new('13/7'); print $x->as_number()," "; # '1' Returns a copy of the object as BigInt by truncating it to integer. bfac() $x->bfac(); Calculates the factorial of $x. For instance: print Math::BigRat->new('3/1')->bfac()," "; # 1*2*3 print Math::BigRat->new('5/1')->bfac()," "; # 1*2*3*4*5 Works currently only for integers. blog() Is not yet implemented. bround()/round()/bfround() Are not yet implemented. is_one() print "$x is 1 " if $x->is_one(); Return true if $x is exactly one, otherwise false. is_zero() print "$x is 0 " if $x->is_zero(); Return true if $x is exactly zero, otherwise false. is_positive() print "$x is >= 0 " if $x->is_positive(); Return true if $x is positive (greater than or equal to zero), otherwise false. Please note that '+inf' is also positive, while 'NaN' and '-inf' aren't. is_negative() print "$x is < 0 " if $x->is_negative(); Return true if $x is negative (smaller than zero), otherwise false. Please note that '-inf' is also negative, while 'NaN' and '+inf' aren't. is_int() print "$x is an integer " if $x->is_int(); Return true if $x has a denominator of 1 (e.g. no fraction parts), otherwise false. Please note that '-inf', 'inf' and 'NaN' aren't inte- ger. is_odd() print "$x is odd " if $x->is_odd(); Return true if $x is odd, otherwise false. is_even() print "$x is even " if $x->is_even(); Return true if $x is even, otherwise false. bceil() $x->bceil(); Set $x to the next bigger integer value (e.g. truncate the number to integer and then increment it by one). bfloor() $x->bfloor(); Truncate $x to an integer value. BUGS
Some things are not yet implemented, or only implemented half-way: inf handling (partial) NaN handling (partial) rounding (not implemented except for bceil/bfloor) $x ** $y where $y is not an integer LICENSE
This program is free software; you may redistribute it and/or modify it under the same terms as Perl itself. SEE ALSO
Math::BigFloat and Math::Big as well as Math::BigInt::BitVect, Math::BigInt::Pari and Math::BigInt::GMP. See <http://search.cpan.org/search?dist=bignum> for a way to use Math::BigRat. The package at <http://search.cpan.org/search?dist=Math%3A%3ABigRat> may contain more documentation and examples as well as testcases. AUTHORS
(C) by Tels <http://bloodgate.com/> 2001-2002. perl v5.8.0 2002-06-01 Math::BigRat(3pm)
All times are GMT -4. The time now is 12:03 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy