0

I have a simple equation written in PHP. I have tried to replicate the equation bellow.

When I work out the Equation on pager using the variables I have provided in the PHP I get 2,467.86 (using equation A).

But when I run it in PHP I get 4,2267.11, where have I gone wrong in my PHP ?

Equation A enter image description here

PHP Equation

<?php $p = 0; $i = 0.06; $c = 12; $n = 1; $r = 200; $x = $i / $c; $y = pow((1 + $x), ($n * $c)); $vf = $p * $y + (($r * $y - 1) / $x); ?> <p>Answer:<?php echo $vf; ?></p> 

1 Answer 1

2

Here:

$vf = $p * $y + ($r * ($y - 1) / $x); // outputs 2467.1124745799 

Your equation was:

$vf = $p * $y + (($r * $y - 1) / $x); // <- NOT $r*$y -1 , but $r*($y-1) 

You can see it here - 3v4l

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.