如何在PHP中做5log(7.5 / 2)这样的数学函数?

如何在PHP中做5log(7.5 / 2)这样的数学函数?

问题描述:

I tried to do it like 5*log(7.5/2), but I think it's the wrong way, can anyone tell me how to do it right ?

我试着像5 * log(7.5 / 2)那样做,但我认为这是错误的方式,可以 有谁告诉我该怎么做? p> div>

In PHP, a base 10 logarithm is made using log10, not log (which is for natural logarithm i.e. base e). Note also that your comparison example in the comments is with 5.7, not 7.5. Try this instead:

echo 1+5*log10(5.7/2);

Output:

3.2742243000426

Demo on 3v4l.org