Re: warnings in Math::Complex

2017-02-09 Thread Jim Gibson
> On Feb 9, 2017, at 7:39 AM, Simon Bauer wrote: > > Hi, > > when I turn on -W in one of my perl scripts then I get a lot of warnings > concerning Math::Complex > > Prototype mismatch: sub Math::Complex::abs (_) vs none at > /usr/share/perl/5.22/Math/Comple

Re: warnings in Math::Complex

2017-02-09 Thread Andy Bach
On Thu, Feb 9, 2017 at 9:39 AM, Simon Bauer wrote: > when I turn on -W in one of my perl scripts then I get a lot of warnings > concerning Math::Complex > > Prototype mismatch: sub Math::Complex::abs (_) vs none at > /usr/share/perl/5.22/Math/Complex.pm line 667. > Prototype

warnings in Math::Complex

2017-02-09 Thread Simon Bauer
Hi,   when I turn on -W in one of my perl scripts then I get a lot of warnings concerning Math::Complex    Prototype mismatch: sub Math::Complex::abs (_) vs none at /usr/share/perl/5.22/Math/Complex.pm line 667.  Prototype mismatch: sub Math::Complex::sqrt (_) vs none at /usr/share/perl/5.22

Re: how to do a reference to a func in Math::Trig

2012-06-24 Thread Charles Smith
Thank you. The useful note about CORE, in particular, is new to me. cts --- On Sun, 6/24/12, Rob Dixon wrote: > From: Rob Dixon > Subject: Re: how to do a reference to a func in Math::Trig > To: "Perl Beginners" > Cc: "Charles Smith" > Date: Sunday, June

Re: how to do a reference to a func in Math::Trig

2012-06-24 Thread Rob Dixon
On 24/06/2012 19:51, Rob Dixon wrote: or by aliasing the current package's 'sin' and 'cos' subroutines with the CORE functions: use strict; use warnings; use Math::Trig; BEGIN { no warnings 'once'; *sin = \&a

Re: how to do a reference to a func in Math::Trig

2012-06-24 Thread Rob Dixon
On 24/06/2012 06:59, Charles Smith wrote: Thank you, that was the clue I needed! This now works for me: ... $f = $opts{f} || "sin"; ... $f = "Math::Complex::$f"; ... print eval ($amplitude) * (&$f (2 * pi * $i/$n) + eval ($dc))."\n"; and

Re: how to do a reference to a func in Math::Trig

2012-06-23 Thread Charles Smith
Thank you, that was the clue I needed! This now works for me: ... $f = $opts{f} || "sin"; ... $f = "Math::Complex::$f"; ... print eval ($amplitude) * (&$f (2 * pi * $i/$n) + eval ($dc))."\n"; and so I can use this, my "siggen" pgm wit

Re: how to do a reference to a func in Math::Trig

2012-06-23 Thread Ron Bergin
Charles Smith wrote: [snip] > > But this pgm fails: > > #!/usr/bin/env perl > use Math::Trig; > my $a = \&Math::Trig::cos; > &$a(0); > > Undefined subroutine &Math::Trig::cos called at modfunctor line 7. > The cos sub is defined in Math::Complex, whic

Re: how to do a reference to a func in Math::Trig

2012-06-23 Thread Charles Smith
n/env perl sub b { print "hello world\n"; } my $a = \&b; &$a; prints hello world But this pgm fails: #!/usr/bin/env perl use Math::Trig; my $a = \&Math::Trig::cos; &$a(0); Undefined subroutine &Math::Trig::cos called at modfunctor line 7. (and other tested variation

Re: how to do a reference to a func in Math::Trig

2012-06-23 Thread Shawn H Corey
On 12-06-23 10:12 AM, Charles Smith wrote: I'm experimenting with Math::Trig and would like to be able to pass the function in as a parameter: $f = $opts{f} || &sin; $f = $opts{f} || \&sin; See `perldoc perlreftut` and `perldoc perlref`. -- Just my 0.0002 million

how to do a reference to a func in Math::Trig

2012-06-23 Thread Charles Smith
Hi, I'm experimenting with Math::Trig and would like to be able to pass the function in as a parameter: $f = $opts{f} || &sin; ... &$f($w); Undefined subroutine &main::sin called at (eval 9)[/usr/lib/perl5/5.14.2/perl5db.pl:640] line 2. I have also tried: $f =

Re: how to clear the cache inside the module use Math::Combinatorics;

2011-06-08 Thread Rob
On 06/06/2011 05:06, eventual wrote: > Hi, > Looking at the combination script below, what must I do so that the output of > Round 1, Round 2 and Round 3 are identical. > Thanks. > > # script below ### > > #!/usr/bin/perl > use strict; > use warni

how to clear the cache inside the module use Math::Combinatorics;

2011-06-05 Thread eventual
Hi, Looking at the combination script below, what must I do so that the output of Round 1, Round 2 and Round 3 are identical. Thanks.   # script below ###    #!/usr/bin/perl use strict; use warnings; use Math::Combinatorics

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

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

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?

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 er

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

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 d

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 g

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 th

Math::GMP

2010-02-24 Thread 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? perl Makefile.PL Checking if y

Re: Shorthand for binary bitwise math?

2010-02-23 Thread Rob Dixon
Uri Guttman wrote: It's generally considered very rude - but the world is full of rude arseholes. Many of them can be found on the perl list. which perl list? there are many. do you include yourself as you are on this list? do you actually help people here (don't recall seeing you in many thr

Re: Shorthand for binary bitwise math?

2010-02-22 Thread Dave Tang
On Tue, 23 Feb 2010 11:23:23 +1000, Steve Bertrand wrote: I belong to several technical lists, and the de-facto standard is to Reply-All. Understood and thank you for your answer. -- Dave Tang -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beg

Re: Shorthand for binary bitwise math?

2010-02-22 Thread Steve Bertrand
On 2010.02.22 17:44, Uri Guttman wrote: >> "1" == 120 writes: > > >> "off list", as I don't like to clog everyone's email with my thank > >> you note. > >> > 1> It's generally considered very rude - but the world is full of rude > 1> arseholes. Many of them can be found on the per

Re: Shorthand for binary bitwise math?

2010-02-22 Thread Uri Guttman
> "1" == 120 writes: >> "off list", as I don't like to clog everyone's email with my thank >> you note. >> 1> It's generally considered very rude - but the world is full of rude 1> arseholes. Many of them can be found on the perl list. which perl list? there are many. do you incl

Re: Shorthand for binary bitwise math?

2010-02-22 Thread Rob Dixon
120 wrote: On Mon, 2010-02-22 at 11:06 +1000, Dave Tang wrote: On Fri, 19 Feb 2010 22:58:24 +1000, 120 wrote: Apologies for my error - if I may point out that sending 'off list' replies is also equally rude. May I ask about this netiquette? I usually thank people who have helped me "off l

Re: Shorthand for binary bitwise math?

2010-02-21 Thread 120
On Mon, 2010-02-22 at 11:06 +1000, Dave Tang wrote: > On Fri, 19 Feb 2010 22:58:24 +1000, 120 wrote: > > > Apologies for my error - if I may point out that sending 'off list' > > replies is also equally rude. > > May I ask about this netiquette? I usually thank people who have helped me > "off

Re: Shorthand for binary bitwise math?

2010-02-21 Thread Dave Tang
On Fri, 19 Feb 2010 22:58:24 +1000, 120 wrote: Apologies for my error - if I may point out that sending 'off list' replies is also equally rude. May I ask about this netiquette? I usually thank people who have helped me "off list", as I don't like to clog everyone's email with my thank you

Re: Shorthand for binary bitwise math?

2010-02-19 Thread 120
On Fri, 2010-02-19 at 14:25 +0200, Shlomi Fish wrote: > Hi, > > On Friday 19 Feb 2010 14:12:51 120 wrote: > > I know I can do this: > > > > $bitvalue=$bitvalue|32 > > > > but is there a shorthand for this? > > > > $bitvalue=|32 does not appear valid - but I'm sure there is probably a > > way? >

Re: Shorthand for binary bitwise math?

2010-02-19 Thread Shlomi Fish
Hi, On Friday 19 Feb 2010 14:12:51 120 wrote: > I know I can do this: > > $bitvalue=$bitvalue|32 > > but is there a shorthand for this? > > $bitvalue=|32 does not appear valid - but I'm sure there is probably a > way? Yes, there is: <<< $bitvalue |= 32; >>> You can also do +=, -=, *=, .= etc

Shorthand for binary bitwise math?

2010-02-19 Thread 120
I know I can do this: $bitvalue=$bitvalue|32 but is there a shorthand for this? $bitvalue=|32 does not appear valid - but I'm sure there is probably a way? Daniel -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.p

Re: Problem with threaded Math::GMP

2009-04-28 Thread Robert Gilmour
t; > > It looks to me that you have 2 perls - a threaded perl in /usr/bin/, and an unthreaded perl in /yaprod/freeware/. It also looks to me that the Math::GMP that you're trying to use was built for (and by) the perl in /usr/bin/. If you're using the perl in /yaprod/freeware/, then you

AW: Problem with threaded Math::GMP

2009-04-28 Thread SCHWARTZKOPFF, Michael, Dr. (Extern)
-Ursprüngliche Nachricht- Von: Brian J. Miller [mailto:wigg...@danconia.org] Gesendet: Dienstag, 28. April 2009 14:15 An: SCHWARTZKOPFF, Michael, Dr. (Extern) Cc: beginners@perl.org Betreff: Re: Problem with threaded Math::GMP SCHWARTZKOPFF, Michael, Dr. (Extern) wrote: > Hi, >

Re: Problem with threaded Math::GMP

2009-04-28 Thread Brian J. Miller
SCHWARTZKOPFF, Michael, Dr. (Extern) wrote: > Hi, > > I wanted to the Net::SSH::Perl but perl complained about a missing > Math::GMP. So did a > cpan install Math::GMP > and finally found > /usr/lib/perl5/site_perl/5.8.8/x86_64-linux-thread-multi/Math/GMP.pm > on my sys

Problem with threaded Math::GMP

2009-04-28 Thread SCHWARTZKOPFF, Michael, Dr. (Extern)
Hi, I wanted to the Net::SSH::Perl but perl complained about a missing Math::GMP. So did a cpan install Math::GMP and finally found /usr/lib/perl5/site_perl/5.8.8/x86_64-linux-thread-multi/Math/GMP.pm on my system. But when I add this path to my lib and started my program I get the error: perl

Re: escaping regex to do math on backreferences

2009-04-13 Thread Chas. Owens
On Mon, Apr 13, 2009 at 06:12, Gunnar Hjalmarsson wrote: snip >> Also, if you make that change you need to check the for loop as well: >> >> for my $i (0 .. 10) { > > Actually no. > > $ perl -wle ' > @rank = qw/A 2 3 4 5 6 7 8 9 10 J Q K A/; > print map $_."[cdhs]", @rank[10..10+4]; > ' > Use of u

Re: escaping regex to do math on backreferences

2009-04-13 Thread Gunnar Hjalmarsson
Chas. Owens wrote: On Sun, Apr 12, 2009 at 21:58, Gunnar Hjalmarsson wrote: Chas. Owens wrote: my @rank = qw/ 2 3 4 5 6 7 8 9 10 J Q K A /; my @rank = qw/A 2 3 4 5 6 7 8 9 10 J Q K A /; --^ snip That depends on who you play with. Ok. Also, if you make that change you

Re: escaping regex to do math on backreferences

2009-04-12 Thread Chas. Owens
On Sun, Apr 12, 2009 at 21:58, Gunnar Hjalmarsson wrote: > Chas. Owens wrote: >> >> my @rank = qw/ 2 3 4 5 6 7 8 9 10 J Q K A /; > >    my @rank = qw/A 2 3 4 5 6 7 8 9 10 J Q K A /; > --^ snip That depends on who you play with. Also, if you make that change you need to check the

Re: escaping regex to do math on backreferences

2009-04-12 Thread Gunnar Hjalmarsson
Chas. Owens wrote: my @rank = qw/ 2 3 4 5 6 7 8 9 10 J Q K A /; my @rank = qw/A 2 3 4 5 6 7 8 9 10 J Q K A /; --^ -- Gunnar Hjalmarsson Email: http://www.gunnar.cc/cgi-bin/contact.pl -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail

Re: escaping regex to do math on backreferences

2009-04-12 Thread Chas. Owens
On Sun, Apr 12, 2009 at 18:34, Andrew Fithian wrote: > Hello everyone, > I have a program that needs to find straights in a hand of cards. The hand > is a string with no whitespace sorted by the cards' ranks, eg "9d10cJhQsKd". > How can I identify if that hand contains a straight with a single reg

Re: escaping regex to do math on backreferences

2009-04-12 Thread Gunnar Hjalmarsson
Andrew Fithian wrote: I have a program that needs to find straights in a hand of cards. Only straights? The hand is a string with no whitespace sorted by the cards' ranks, eg "9d10cJhQsKd". How can I identify if that hand contains a straight with a single regex? Why on earth would you want

escaping regex to do math on backreferences

2009-04-12 Thread Andrew Fithian
Hello everyone, I have a program that needs to find straights in a hand of cards. The hand is a string with no whitespace sorted by the cards' ranks, eg "9d10cJhQsKd". How can I identify if that hand contains a straight with a single regex? Is that even possible? Is there a way to escape the regex

Re: substitute math

2008-12-20 Thread Owen
> Hi, > > I have a variable for which I ultimately want to substitute w/ some > math. Is there a way to get the result "6"? > > my $number=123; > $number =~s/123/1+2+3/s; #This method results in "1+2+3", not the "6" > I am looking for > p

Re: substitute math

2008-12-20 Thread Chas. Owens
On Sat, Dec 20, 2008 at 01:04, hotkitty wrote: > Hi, > > I have a variable for which I ultimately want to substitute w/ some > math. Is there a way to get the result "6"? > > my $number=123; > $number =~s/123/1+2+3/s; #This method results in "1+2+3"

substitute math

2008-12-20 Thread hotkitty
Hi, I have a variable for which I ultimately want to substitute w/ some math. Is there a way to get the result "6"? my $number=123; $number =~s/123/1+2+3/s; #This method results in "1+2+3", not the "6" I am looking for print "$number"; -- To unsubscribe

Re: read multiple csv files into array, do some math

2008-11-20 Thread Stealth
On Thursday 20 November 2008 12:50:23 am Graham Saathoff wrote: > Is this right? Any suggestions for how to build something like > this? I would suggest that you get a copy of this book "Learning Perl" 5th Edition. ISBN: 978-0-596-52010-6 Authors: Randal L. Schwartz, Tom Phoenix & brian d foy (T

Re: read multiple csv files into array, do some math

2008-11-20 Thread Raymond Wan
Hi Graham, Graham Saathoff wrote: Is this right? Any suggestions for how to build something like this? Well, you have the right idea in that you're planning out what you are doing. In general, if you have hundreds of files, what you should do depends on how big they are. You mention

read multiple csv files into array, do some math

2008-11-19 Thread Graham Saathoff
rd/value to each line? Maybe this should be done before concatenation, but I'm not sure how.) * Read the file into an array, using a comma to delimit fields in the array. * Do some math -- add all of the "totals" columns together and output that number to a text file, with a brief t

Re: installing Math::Complex

2008-01-12 Thread sisyphus
On Jan 12, 6:06 am, [EMAIL PROTECTED] (Anjan Purkayastha) wrote: > i too am having problems installing the Math::Complex module. Math::Complex (and Math::Trig) has been part of core perl for quite some time. I would expect that you already have it. Cheers, Rob -- To unsubscribe, e-mail: [EM

Re: installing Math::Complex

2008-01-11 Thread Chas. Owens
On Jan 11, 2008 2:06 PM, ANJAN PURKAYASTHA <[EMAIL PROTECTED]> wrote: > i too am having problems installing the Math::Complex module. Specifically, > LWP does not seem to be available. At the end of the build steps I get an > error message: > writing makefile for Math::Complex

installing Math::Complex

2008-01-11 Thread ANJAN PURKAYASTHA
i too am having problems installing the Math::Complex module. Specifically, LWP does not seem to be available. At the end of the build steps I get an error message: writing makefile for Math::Complex Not OK running make test Can't test without successul make Running make install make had ret

Re: where to download Perl Module Math::Trig::acos()

2008-01-11 Thread Chas. Owens
On Jan 11, 2008 1:46 PM, Jenny Chen <[EMAIL PROTECTED]> wrote: > Hi everyone, > > How is everybody doing? I need to use Math::Trig::acos(), but not able to > find it on CPAN. Does anyone know where I can download it from? > > Thanks > > Jenny > acos is in

where to download Perl Module Math::Trig::acos()

2008-01-11 Thread Jenny Chen
Hi everyone, How is everybody doing? I need to use Math::Trig::acos(), but not able to find it on CPAN. Does anyone know where I can download it from? Thanks Jenny

Re: Simple perl math caculation question

2007-07-10 Thread Vincent Li
On Tue, 10 Jul 2007, Chas Owens wrote: On 7/10/07, Vincent Li <[EMAIL PROTECTED]> wrote: I am trying to experiment a simple perl math caculation script I wrote: #!/usr/bin/perl use strict; use warnings; my %operator = ( minus => '-', add =&g

Re: Simple perl math caculation question

2007-07-10 Thread Martin Barth
On Tue, 10 Jul 2007 11:32:54 -0700 (PDT) Vincent Li <[EMAIL PROTECTED]> wrote: > > I am trying to experiment a simple perl math caculation script I wrote: > > #!/usr/bin/perl > use strict; > use warnings; > > my %operator = ( > minus => &#x

Re: Simple perl math caculation question

2007-07-10 Thread Chas Owens
On 7/10/07, Vincent Li <[EMAIL PROTECTED]> wrote: I am trying to experiment a simple perl math caculation script I wrote: #!/usr/bin/perl use strict; use warnings; my %operator = ( minus => '-', add => '+', multiply => '*',

Re: Simple perl math caculation question

2007-07-10 Thread Paul Lalli
On Jul 10, 2:32 pm, [EMAIL PROTECTED] (Vincent Li) wrote: > I am trying to experiment a simple perl math caculation script I wrote: > > #!/usr/bin/perl > use strict; > use warnings; > > my %operator = ( > minus => '-', > add =>

Simple perl math caculation question

2007-07-10 Thread Vincent Li
I am trying to experiment a simple perl math caculation script I wrote: #!/usr/bin/perl use strict; use warnings; my %operator = ( minus => '-', add => '+', multiply => '*', divide => '/', ); my $big = 5; my $small = 2; fo

Re: GMP for Math::BigInt not working ?

2007-06-03 Thread Mumia W.
On 06/03/2007 10:42 AM, Mumia W. wrote: [...] the docs say that the Math::GMP module is not used by Math::BigInt::GMP. Math::BigInt::GMP uses the binary GMP library if it's installed, so perhaps you could look there. Duh. Of course you have the binary GMP library installed--othe

Re: GMP for Math::BigInt not working ?

2007-06-03 Thread Mumia W.
On 06/03/2007 08:40 AM, David Unric wrote: Any idea why the following code falls back to slow standard Perl implementation of BigInt module instead of highspeed GMP being used ? (no warnings, GMP module _is_ installed) --- use Math::BigInt lib => 'GMP'; m

GMP for Math::BigInt not working ?

2007-06-03 Thread David Unric
Any idea why the following code falls back to slow standard Perl implementation of BigInt module instead of highspeed GMP being used ? (no warnings, GMP module _is_ installed) --- use Math::BigInt lib => 'GMP'; my $fac = Math::BigInt->new('4000'

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: >>&g

Re: Math::BigFloat

2007-04-25 Thread Rob Dixon
methods. Bcoz the examples in the doc aren't working. Can i get some simple examples? What are you doing that isn't working? "Because" if the documentation examples don't work for you, why should this work? #!/usr/bin/perl use strict; use warnings; use Math::BigFloat

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

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

Re: Math::BigFloat

2007-04-24 Thread Tom Phoenix
simple examples? What are you doing that isn't working? "Because" if the documentation examples don't work for you, why should this work? #!/usr/bin/perl use strict; use warnings; use Math::BigFloat; my $big = Math::BigFloat->new(200); my $other = Math::BigFloat->

Math::BigFloat

2007-04-24 Thread Somu
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? -- To unsubscribe, e-mail: [EMAIL PROTECTED] F

Re: bizarre fractional exponents math

2006-09-16 Thread Peter Scott
On Fri, 15 Sep 2006 08:33:02 -0700, Bryan R Harris wrote: > Thank you, everyone! > > Note, it appears that the fifth root of -12.17 is not complex, try this: > > % perl -wle '$_=(-1.648382957144284)**5; print' > > ... but I don't blame perl for not finding it. The fact that 0.2 has no exact bin

Re: bizarre fractional exponents math

2006-09-15 Thread Bryan R Harris
Thank you, everyone! Note, it appears that the fifth root of -12.17 is not complex, try this: % perl -wle '$_=(-1.648382957144284)**5; print' ... but I don't blame perl for not finding it. Thanks for the tips on -wle, and for the info on print. I'm not sure how I'll do it, but I really need

Re: bizarre fractional exponents math

2006-09-15 Thread Dr.Ruud
Bryan R Harris schreef: > Can someone explain this behavior? > > % perl -e 'print -12.17**0.2, "\n"' > -1.64838295714428 > % perl -e 'print (-12.17)**(0.2), "\n"' > -12.17% perl -e 'print ((-12.17)**(0.2)), "\n"' > nan% Use "perl -we ...", or "perl -Mwarnings -e ...". -- Affijn, Ruud "Gewoon i

Re: bizarre fractional exponents math

2006-09-14 Thread Mumia W.
On 09/14/2006 06:47 PM, Bryan R Harris wrote: Can someone explain this behavior? % perl -e 'print -12.17**0.2, "\n"' -1.64838295714428 % perl -e 'print (-12.17)**(0.2), "\n"' -12.17% perl -e 'print ((-12.17)**(0.2)), "\n"' nan% Yes, the "\n" isn't getting printed for some reason on the 2nd tw

Re: bizarre fractional exponents math

2006-09-14 Thread Rob Dixon
Bryan R Harris wrote: Can someone explain this behavior? % perl -e 'print -12.17**0.2, "\n"' -1.64838295714428 This means print(-(12.17 ** 0.2), "\n") because exponentiation has a higher priority than unary minus. (See the table of priorities in perldoc perlop). % perl -e 'print (-12.17)

Re: bizarre fractional exponents math

2006-09-14 Thread John W. Krahn
Bryan R Harris wrote: > > Can someone explain this behavior? perldoc perlfunc [snip] Any function in the list below may be used either with or without parentheses around its arguments. (The syntax descriptions omit the parentheses.) If you use the parentheses, the simple (b

bizarre fractional exponents math

2006-09-14 Thread Bryan R Harris
Can someone explain this behavior? % perl -e 'print -12.17**0.2, "\n"' -1.64838295714428 % perl -e 'print (-12.17)**(0.2), "\n"' -12.17% perl -e 'print ((-12.17)**(0.2)), "\n"' nan% Yes, the "\n" isn't getting printed for some reason on the 2nd two examples. Bottom line: -12.17**0.2 ==> -1.6

Re: argument for Math::MatrixReal

2006-08-22 Thread Offer Kaye
On 8/21/06, chen li wrote: Dear all, I read a file into an array reference. I want to pass it as an argument when create the new object from Math::MatrixReal. But when I read the usage of this module I can't find how. Does anyone there give me a hand? Thanks, Li Here are the code I use

argument for Math::MatrixReal

2006-08-21 Thread chen li
Dear all, I read a file into an array reference. I want to pass it as an argument when create the new object from Math::MatrixReal. But when I read the usage of this module I can't find how. Does anyone there give me a hand? Thanks, Li Here are the code I use: my $re

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
nd 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. :) In

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

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

math module and array manipulation

2006-08-14 Thread chen li
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. Thanks, Li __ Do You Yahoo!? Tired of spam? Yahoo! Mail has

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

math formula substitution and evaluation

2006-07-15 Thread Daniel D Jones
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, using the values from @variables, where $variable[0] holds the value of the variable 'a', $variables[1] holds the value

Re: Help: Math::Pari won't install

2006-02-28 Thread Wiggins d'Anconia
RICHARD FERNANDEZ wrote: > > Thanks for the response. I did manage to solve the Math::Pari install > problem by following Jeff Eggen's idea about configuring it with > machine=none. I have no idea about whether or not, as he mentions, it's > unusably slow because I proce

RE: Help: Math::Pari won't install

2006-02-28 Thread RICHARD FERNANDEZ
This has lingered long enough without response. Sorry it took me a while to get back to it after initially seeing it. I had this same problem a couple of years ago. It does appear that Math::PARI has an active maintainer again so you might try dropping him a line about this issue. I solved it by

Re: Help: Math::Pari won't install

2006-02-28 Thread Wiggins d'Anconia
RICHARD FERNANDEZ wrote: > I'm trying to build Math::Pari along the way to building Net::SFTP, but > the make fails with the following error: > > pariinl.h: In function `mulssmod': > pariinl.h:887: error: asm-specifier for variable `hiremainder' conflicts > with

Help: Math::Pari won't install

2006-02-22 Thread RICHARD FERNANDEZ
I'm trying to build Math::Pari along the way to building Net::SFTP, but the make fails with the following error: pariinl.h: In function `mulssmod': pariinl.h:887: error: asm-specifier for variable `hiremainder' conflicts with asm clobber list pariinl.h:887: confused by earlier erro

  1   2   >