duansha6410 2019-02-08 05:56
浏览 118
已采纳

如何在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 ?

  • 写回答

1条回答 默认 最新

  • dongxun1142 2019-02-08 06:58
    关注

    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

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料