Wrong result by Java Math.pow

后端 未结 6 1845
挽巷
挽巷 2020-12-06 17:17

If you try to run the following code

public class Main {
   public static void main(String[] args) {
       long a = (long)Math.pow(13, 15);
       System.ou         


        
6条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-06 18:00

    The correct answer is to provide the closest number which can be represented by a double

    Have you checked whether this is the case or not?

提交回复
热议问题