on Tue, 14 May 2002 20:00:05 GMT, [EMAIL PROTECTED] (Jeff
O'Connell) wrote: 

> I'm trying to figure out how to do the following in Perl. Can
> anyone help me?
> 
> Problem:
> Design and implement a perl program that will evaluate a
> polynomial expression of arbitrary degree for a given value of x.

As others explained already, we are not going to do your homework for 
you, but I would like to comment on your definition of a polynomial, 
which looks a little odd to me.

I would define a polynomial of degree $n in unknown $x as follows:

$y = $a[0] + $a[1]*$x + ... + $a[$n-1]*$x**($n-1) + $a[n]*$x**$n;

This free Perl syntax should get you started.
(Note to regulars: the '...' is *not* the three-dot version of the 
range operator :-)

Show us your finished program and we'll discuss it.

-- 
felix
 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to