java中是否有查找反日志的函数?

java中是否有查找反日志的函数?,java,math,natural-logarithm,Java,Math,Natural Logarithm,我想知道java中是否有一个函数可以查找日志,或者我必须自己实现它?如果是,我如何实现它?Math.exp(x)返回ex 例如: public static void main(String[] args) { System.out.println(Math.log(5)); // prints 1.6094... System.out.println(Math.exp(1)); // prints 2.7182... System.out.println(Math.ex

我想知道java中是否有一个函数可以查找日志,或者我必须自己实现它?如果是,我如何实现它?

Math.exp(x)
返回ex

例如:

public static void main(String[] args) {
    System.out.println(Math.log(5)); // prints 1.6094...
    System.out.println(Math.exp(1)); // prints 2.7182...
    System.out.println(Math.exp(Math.log(5)); // prints 5.0000...
}

难道不应该为你做这件事吗?Math.pow并不总是准确的。有一次,我用Math.pow()将759提高到2的幂,并将其键入(long),结果得到了一个错误的答案。我不得不把代码改成759*759。这正是我想要的答案