The aim of this page is to demonstrate the difference between
Note:PGLabs is an efficient way to check code.
$f = Compute(sqrt(3x + 1); $fx = $f->eval(x=>"3"); displays 3.16228
The correct answer is a number.
$f = Compute(sqrt(3x + 1); $fx = $f->substitute(x=>"3"); displays (3.16228)
The correct answer is a formula (hence the parenthesis)
One of the biggest differences between
substitute is when they are used in conjunction with flags such as
reduceConstantFunctions, which is described in more detail at:FormattingCorrectAnswers:_NumbersAndFormulas