C
coolchick
Hi All,
I am trying to compute few equations using perl.
This is the equation that I am trying to solve:
MI=171-5.2*ln(aveV)-0.23*aveV(g)-16.2*ln(aveLOC)
+50sin(sqrt(2.46*perCM))
I have all the variables: aveV, aveV(g), aveLOC and perCM.
So the equation is:
$MI=171 - (5.2*(2.303*log($aveV)))-(0.23*$ecc)-
(16.2*(2.303*log($aveLOC)))+(50*(sin(sqrt(2.46*$perCM))));
where:
$aveV= 239.530014548124
$ecc=9
$aveLOC=47
$perCM=0.297872340425532
I am not getting the correct answer. I get MI=-2.56217048794884, which
is not correct.
I tried to break it down and the problem is that I don't think I have
the right libraries for math.
It is not computing sqrt, log, and sin correctly.
I am using:
use Math::Complex;
use Math::Trig;
Any help would be great!
Thanks,
naureen
I am trying to compute few equations using perl.
This is the equation that I am trying to solve:
MI=171-5.2*ln(aveV)-0.23*aveV(g)-16.2*ln(aveLOC)
+50sin(sqrt(2.46*perCM))
I have all the variables: aveV, aveV(g), aveLOC and perCM.
So the equation is:
$MI=171 - (5.2*(2.303*log($aveV)))-(0.23*$ecc)-
(16.2*(2.303*log($aveLOC)))+(50*(sin(sqrt(2.46*$perCM))));
where:
$aveV= 239.530014548124
$ecc=9
$aveLOC=47
$perCM=0.297872340425532
I am not getting the correct answer. I get MI=-2.56217048794884, which
is not correct.
I tried to break it down and the problem is that I don't think I have
the right libraries for math.
It is not computing sqrt, log, and sin correctly.
I am using:
use Math::Complex;
use Math::Trig;
Any help would be great!
Thanks,
naureen