in reply to
Re^2: Regarding the polynomial evaluation. Stuck at one part. please helpppp!!
in thread Calculating polynomials and pushing them into an array. Stuck at one part. please helpppp!!
You are missing a bracket:
-0.137 + (0.00479 / (W/0.9)) + (2.5593 * (W/0.9 ) ,0.045,0
-0.137 + (0.00479 / (W/0.9)) + (2.5593 * (W/0.9 ) <---- HERE ,0.045,0
I still dont understand how this works - but it does!
Including testing code that ( I am not sure how ) works!
use strict ;
use warnings ;
#first parameter gives the polynominal string
#second parameter gives the min-des width
#third parameter gives the short-line length
$polynominal =~ s/W/$curWidth/g ;#replace W with current value of
$polynominal =~ s/L/$curLength/g ;#replace L with current value of
++ min Length
my $result ;
eval( $result = $polynominal ) ;
# print "$result\n"; -- PRINTS THE STRING
return eval ($polynominal); # Returns '0.086765' - WHY?
my $one = EvalPolynominal( '-0.137 + (0.00479 / (W/0.9)) + (2.5593 * (
+W/0.9 ))' ,0.045,0 );