Re: Math::GMP

2010-02-25 Thread Dave Tang
Hi Shlomi. OK, seems like it's Red Hat Enterprise Linux 5 / CentOS 5. You can find a package for Net-SSH-Perl for them on the DAG package repository: http://dag.wieers.com/rpm/packages/perl-Net-SSH-Perl/ You should install from it. You should install GMP using yum: "yum install gmp-devel" or

Re: Math::GMP

2010-02-25 Thread Dave Tang
On Thu, 25 Feb 2010 19:54:13 +1000, Salvador Fandino wrote: On 02/25/2010 07:14 AM, Dave Tang wrote: Dear list, I'm trying to use Net::SSH::Perl, but it requires the Math::GMP module. I have installed a GMP library (required for Math::GMP) but when I try to install Math::GMP I get an error.

Re: Math::GMP

2010-02-25 Thread Dave Tang
On Thu, 25 Feb 2010 19:54:13 +1000, Salvador Fandino wrote: On 02/25/2010 07:14 AM, Dave Tang wrote: Dear list, I'm trying to use Net::SSH::Perl, but it requires the Math::GMP module. I have installed a GMP library (required for Math::GMP) but when I try to install Math::GMP I get an error.

Re: Math::GMP

2010-02-25 Thread Salvador Fandino
On 02/25/2010 07:14 AM, Dave Tang wrote: Dear list, I'm trying to use Net::SSH::Perl, but it requires the Math::GMP module. I have installed a GMP library (required for Math::GMP) but when I try to install Math::GMP I get an error. Here's the transcript. May someone shed some light? Net::SSH::

Re: Math::GMP

2010-02-25 Thread Dave Tang
On Thu, 25 Feb 2010 18:30:33 +1000, Octavian Rasnita wrote: From: "Dave Tang" Dear list, I'm trying to use Net::SSH::Perl, but it requires the Math::GMP module. I have installed a GMP library (required for Math::GMP) but when I try to install Math::GMP I get an error. Here's the transc

Re: Math::GMP

2010-02-25 Thread Shlomi Fish
On Thursday 25 Feb 2010 10:27:28 Dave Tang wrote: > On Thu, 25 Feb 2010 17:27:25 +1000, Shlomi Fish > > wrote: > > Hi Dave! > > Hi Shlomi! > Hi Dave. > Thank you for your reply. > > [snip] > > >> I'm trying to use Net::SSH::Perl, but it requires the Math::GMP module. > >> I > >> have instal

Re: Math::GMP

2010-02-25 Thread Octavian Rasnita
From: "Dave Tang" Dear list, I'm trying to use Net::SSH::Perl, but it requires the Math::GMP module. I have installed a GMP library (required for Math::GMP) but when I try to install Math::GMP I get an error. Here's the transcript. May someone shed some light? I don't know your OS or versi

Re: Math::GMP

2010-02-25 Thread Dave Tang
On Thu, 25 Feb 2010 17:27:25 +1000, Shlomi Fish wrote: Hi Dave! Hi Shlomi! Thank you for your reply. [snip] I'm trying to use Net::SSH::Perl, but it requires the Math::GMP module. I have installed a GMP library (required for Math::GMP) but when I try to install Math::GMP I get an error

Re: Math::GMP

2010-02-24 Thread Shlomi Fish
Hi Dave! On Thursday 25 Feb 2010 08:14:11 Dave Tang wrote: > Dear list, > > I'm trying to use Net::SSH::Perl, but it requires the Math::GMP module. I > have installed a GMP library (required for Math::GMP) but when I try to > install Math::GMP I get an error. Here's the transcript. May someone sh

Re: Math::BigFloat

2007-04-26 Thread Somu
Thanks. I got that corrected. Actually, in my code, $n wasnt a Math::BigFloat OBJECT. On 4/25/07, Rob Dixon <[EMAIL PROTECTED]> wrote: Somu wrote: > On 4/25/07, Tom Phoenix <[EMAIL PROTECTED]> wrote: >> >> On 4/24/07, Somu <[EMAIL PROTECTED]> wrote: >>> >>> I'm unable to compare numbers using th

Re: Math::BigFloat

2007-04-25 Thread Rob Dixon
Somu wrote: On 4/25/07, Tom Phoenix <[EMAIL PROTECTED]> wrote: On 4/24/07, Somu <[EMAIL PROTECTED]> wrote: I'm unable to compare numbers using the module. Actually i can only use it to create numbers like 0 or inf or 1 or their negatives. But i dont know how to use their methods. Bcoz the exa

Re: Math::BigFloat

2007-04-25 Thread Chas Owens
On 4/25/07, Somu <[EMAIL PROTECTED]> wrote: Actually the following isnt working: use Math::BigFloat; $n = 0; if ($n->is_zero()) {print 'you entered zero'} snip Umm, that is because $n is not a Math::BigFloat. Math::BigFloat is not a pragma, it is a class that overloads the math operators s

Re: Math::BigFloat

2007-04-25 Thread Somu
Actually the following isnt working: use Math::BigFloat; $n = 0; if ($n->is_zero()) {print 'you entered zero'} On 4/25/07, Tom Phoenix <[EMAIL PROTECTED]> wrote: On 4/24/07, Somu <[EMAIL PROTECTED]> wrote: > I'm unable to compare numbers using the module. Actually i can only > use it to creat

Re: Math::BigFloat

2007-04-24 Thread Tom Phoenix
On 4/24/07, Somu <[EMAIL PROTECTED]> wrote: I'm unable to compare numbers using the module. Actually i can only use it to create numbers like 0 or inf or 1 or their negatives. But i dont know how to use their methods. Bcoz the examples in the doc aren't working. Can i get some simple examples?

Re: math module and array manipulation

2006-08-16 Thread chen li
--- David Greenberg <[EMAIL PROTECTED]> wrote: > I'm sure there's an easier/better way of doing this, > but in the interest of > simplicity, let's look at this approach: > > First, a red flag goes up when you say that you have > an array of 12 > numbers. Will it always be twelve? > > The seco

Re: math module and array manipulation

2006-08-15 Thread David Greenberg
I'm sure there's an easier/better way of doing this, but in the interest of simplicity, let's look at this approach: First, a red flag goes up when you say that you have an array of 12 numbers. Will it always be twelve? The second red flag is that you are splitting the array into quarters based

Re: math module and array manipulation

2006-08-15 Thread JupiterHost.Net
I have an array contains 12 numbers. I want to calculate the mean and standard deviation for very three numbers. I just wonder which math module is available to do the job. Wonder no longer :) Find out for sure: http://search.cpane.org/ I think you meant http://search.cpan.org. :) Inde

RE: math module and array manipulation

2006-08-14 Thread Timothy Johnson
-Original Message- From: JupiterHost.Net [mailto:[EMAIL PROTECTED] Sent: Monday, August 14, 2006 4:48 PM To: beginners@perl.org Subject: Re: math module and array manipulation > chen li wrote: >> Dear all, >> >> I have an array contains 12 numbers. I want to >

Re: math module and array manipulation

2006-08-14 Thread JupiterHost.Net
chen li wrote: Dear all, I have an array contains 12 numbers. I want to calculate the mean and standard deviation for very three numbers. I just wonder which math module is available to do the job. Wonder no longer :) Find out for sure: http://search.cpane.org/ -- To unsubscribe, e-mail:

Re: math formula substitution and evaluation

2006-07-16 Thread Daniel D Jones
On Sunday 16 July 2006 13:20, Charles K. Clarkson wrote: > Daniel D Jones wrote: > : Ah! Simple change: > >Subroutines should not normally operate on external data. What do you mean by "operate on?" I avoid altering external data, but I don't see the harm in reading external data. Too, thi

RE: math formula substitution and evaluation

2006-07-16 Thread Charles K. Clarkson
Daniel D Jones wrote: : Ah! Simple change: Subroutines should not normally operate on external data. Pass data into and out of each subroutine. As a matter of style, I avoidsqashingwordsinvariableandsuborutinenamesalltogether. I like to use an underscore for most names. run_tests( [EMAIL P

Re: math formula substitution and evaluation

2006-07-16 Thread Dr.Ruud
Daniel D Jones schreef: > Given something like the following: > > my @variables = [3, 7, 13, 4, 12]; > my @tests = ("2*a+b==c", "c-d+a==e"); > > I need to be able to evaluate the mathematical truth of the tests #!/usr/bin/perl # beware: this approach is wrong use warnings; use strict; my

Re: math formula substitution and evaluation

2006-07-16 Thread Daniel D Jones
On Sunday 16 July 2006 07:26, Paul Johnson wrote: > On Sun, Jul 16, 2006 at 05:48:10AM -0400, Daniel D Jones wrote: > > It certainly does help. I thought about substitution but couldn't > > come up with a syntax. This seems to be exactly what I was looking > > for, but I'm running into a problem.

Re: math formula substitution and evaluation

2006-07-16 Thread Paul Johnson
On Sun, Jul 16, 2006 at 05:48:10AM -0400, Daniel D Jones wrote: > It certainly does help. I thought about substitution but couldn't > come up with a syntax. This seems to be exactly what I was looking > for, but I'm running into a problem. Here's code which demonstrates > it: [ ... ] > As you

Re: math formula substitution and evaluation

2006-07-16 Thread Daniel D Jones
On Saturday 15 July 2006 21:13, Rob Dixon wrote: > Daniel D Jones wrote: > > Given something like the following: > > > > my @variables = [3, 7, 13, 4, 12]; > > You want round brackets here. You've created an array with just one > element, with a reference to an anonymous array as its value. Doh

Re: math formula substitution and evaluation

2006-07-16 Thread Rob Dixon
John W. Krahn wrote: > > Rob Dixon wrote: >> >>s/([a-z])/$variables[ord($1) - ord('a')]/ge; > > You don't need the /e option there. (Try it if you don't believe me.) Fascinating. Thanks John. And all because the expression's inside an array index. s/([a-z])/$variables[do{ my $n = ord(

Re: math formula substitution and evaluation

2006-07-15 Thread John W. Krahn
Rob Dixon wrote: > > You can do exactly that in Perl, and a lot more simply: > > my @variables = (3, 7, 13, 4, 12); > my @tests = ("2*a+b==c", "c-d+a==e"); > > foreach (@tests) { > s/([a-z])/$variables[ord($1) - ord('a')]/ge; You don't need the /e option there. (Try it if you don't b

Re: math formula substitution and evaluation

2006-07-15 Thread Aaron Priven
On Jul 15, 2006, at 5:15 PM, Daniel D Jones wrote: Given something like the following: my @variables = [3, 7, 13, 4, 12]; As an aside, you meant parentheses here, not brackets. (Brackets return a reference to an anonymous array containing the list, not the list itself.) my @tests = ("2

Re: math formula substitution and evaluation

2006-07-15 Thread Rob Dixon
Daniel D Jones wrote: > Given something like the following: > > my @variables = [3, 7, 13, 4, 12]; You want round brackets here. You've created an array with just one element, with a reference to an anonymous array as its value. > my @tests = ("2*a+b==c", "c-d+a==e"); > > I need to be able to

Re: math formula substitution and evaluation

2006-07-15 Thread Tom Phoenix
On 7/15/06, Daniel D Jones <[EMAIL PROTECTED]> wrote: my @variables = [3, 7, 13, 4, 12]; my @tests = ("2*a+b==c", "c-d+a==e"); I need to be able to evaluate the mathematical truth of the tests, May I suggest Parse::RecDescent? If you can make a grammar out of your algebra, you'll have an easy

Re: Math::BigInt maximum value

2006-02-08 Thread Tom Phoenix
On 2/8/06, Rob Benton <[EMAIL PROTECTED]> wrote: > What are the limitatins of Math::BigInt? I ask because I have a c++ > program that outputs an unsigned 64 bit integer that my perl script > picks up. Am I safe to use BigInt for this on all platforms? Have you seen the wording "Arbitrary size i

Re: Math Question

2006-01-30 Thread Tom Phoenix
On 1/30/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > I know that Perl has a function to determine the square root of a number. > For example, to determine the square root of 121 code "sqrt(121)". Is there a > built-in Perl function that enables one to determine the nth root of a number > w

Re: Math::Currency compilation failure

2005-09-20 Thread Todd W
"Peter Rabbitson" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > Hello list, > > I am trying to install Math::Currency from cpan and I can not make > > anything out of the error message I get. Any advice would be > > appreciated. > > > > Peter > > > > > > > > CPAN.pm: G

Re: Math::Currency compilation failure

2005-09-20 Thread Peter Rabbitson
> Hello list, > I am trying to install Math::Currency from cpan and I can not make > anything out of the error message I get. Any advice would be > appreciated. > > Peter > > > > CPAN.pm: Going to build J/JP/JPEACOCK/Math-Currency-0.40.tar.gz > > Checking if your kit is complete...

Re: Math::BigInt

2005-03-16 Thread JupiterHost.Net
my $x = Math::BigFloat->new(2); Math::BigFloat->precision(5); # 5 digits max my $y = $x->copy()->bdiv(3); # will give 0.6 print Dumper $y; The docs says "will give 0.6" so how does one get $y to give you that? That is what I can't seem to find and the Dump of $y doe

Re: Math::BigInt

2005-03-16 Thread Jay Savage
On Wed, 16 Mar 2005 13:39:34 -0600, JupiterHost.Net <[EMAIL PROTECTED]> wrote: > Hello, > > My goal is to divide two whole numbers and get the results to a given > number of decimals. [cut] > #!/usr/bin/perl > > use strict; > use warnings; > use Math::BigFloat; > use Data::Dumper; [cut] > my

Re: Math::BigInt

2005-03-16 Thread JupiterHost.Net
Peter Rabbitson wrote: AFAIK perl will handle up to 15 (14 to be exact) precision without any helpers like Math::BigFloat. Then you just use sprintf ('%.Xf', $var) where X is the precision you want. Keep in mind that standard rounding is enforced (.4 - .5 as breakpoint) Thanks Peter I think I w

Re: Math::BigInt

2005-03-16 Thread Peter Rabbitson
AFAIK perl will handle up to 15 (14 to be exact) precision without any helpers like Math::BigFloat. Then you just use sprintf ('%.Xf', $var) where X is the precision you want. Keep in mind that standard rounding is enforced (.4 - .5 as breakpoint) Peter > Hello, > > My goal is to divide two

Re: math stuff...

2003-07-01 Thread mgoland
- Original Message - From: "Ling F. Zhang" <[EMAIL PROTECTED]> Date: Tuesday, July 1, 2003 7:04 am Subject: math stuff... > okay...I am glad @ how easy it is to use perl scalar > both as numerical value and string...but sometimes I > just need to do integer division the C way: sure, you

Re: math stuff...

2003-07-01 Thread Rob Dixon
Ling F. Zhang wrote: > okay...I am glad @ how easy it is to use perl scalar > both as numerical value and string...but sometimes I > just need to do integer division the C way: > > when 10/3, I want it to equal to 3, not 3.3 > is there an operator for such operation? or do I have > to do li

RE: math stuff...

2003-07-01 Thread Hanson, Rob
A few ways depending on your exact need... (See: perldoc -f int) my $x = int(10/3); # $x = 3 (See: perldoc integer) use integer; my $x = 10 / 3; # $x = 3 (See: perldoc -f sprintf) my $x = sprintf("%d", 10/3); # $x = 3 (rounded down) Rob -Original Message- From: Ling F. Zhang [mailto:[

RE: Math Trig

2003-06-04 Thread Wagner, David --- Senior Programmer Analyst --- WGO
anthony wrote: > Hi, > > I'm looking for a module instead of working with radians i want to > work with degrees, how would that be possible. > > Any help is appreciated > > Anthony Since you did not state what type of machine, I went to CPAN and here are two: Math::Trig::Degree Invers

Re: Math::BigInt

2001-11-14 Thread Tels
-BEGIN PGP SIGNED MESSAGE- Moin, sorry for respondint so late, I don't read that list. >Gibbs Tanton writes: >> You might want to try Math::BigFloat instead. > >I originally wrote: >> I'm trying to perform the following calculation: >> $value = ($float + $integer) * 10; >> $string

Re: Math::BigInt

2001-10-29 Thread Curtis Poe
--- Frank Newland <[EMAIL PROTECTED]> wrote: > Readers, > > I've been to cpan.org site but some of the pages are not appearing. > what does Math::BigInt do in the following perl line? > > $amount= Math::BigInt ->new("$posted_amount"); > > > tia, > > Frank > > -- > To unsubscribe, e-mail

RE: Math::BigInt

2001-10-29 Thread Bob Showalter
> -Original Message- > From: Frank Newland [mailto:[EMAIL PROTECTED]] > Sent: Monday, October 29, 2001 11:57 AM > To: [EMAIL PROTECTED] > Subject: Math::BigInt > > > Readers, > > I've been to cpan.org site but some of the pages are not appearing. > what does Math::BigInt do in the follo

Re: Math and Perl

2001-10-03 Thread Brett W. McCoy
On Wed, 3 Oct 2001, Sofia wrote: > I am doing some division in my perl program but the > result of the division is a number with many decimal > places (12.34567899) How can I truncate the number to > just two decimal places and round up or down if > necessary? Is there a module that will let me

RE: Math and Perl

2001-10-03 Thread Bob Showalter
> -Original Message- > From: Sofia [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, October 03, 2001 4:57 PM > To: [EMAIL PROTECTED] > Subject: Math and Perl > > > I am doing some division in my perl program but the > result of the division is a number with many decimal > places (12.3456789

Re: Math::BigInt

2001-09-14 Thread Richard J. Barbalace
Gibbs Tanton writes: > You might want to try Math::BigFloat instead. I originally wrote: > I'm trying to perform the following calculation: > $value = ($float + $integer) * 10; > $string = "$value:test"; I now have code like the following: use Math::BigFloat; # Initial values my $float =

RE: Math::BigInt

2001-09-13 Thread Gibbs Tanton - tgibbs
You might want to try Math::BigFloat instead. -Original Message- From: Richard J. Barbalace To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: 9/13/2001 2:17 PM Subject: Math::BigInt Hi. I'm trying to perform the following calculation: $value = ($float + $integer) * 10; $string = "$

Re: math

2001-07-20 Thread Mooney Christophe-CMOONEY1
'use integer' will force integer calculations. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]