Java平方不能用^ .用Math.pow(x, 2)

来源:互联网 发布:js设置input失去焦点 编辑:程序博客网 时间:2024/05/16 07:43

Java平方不能用^ .用Math.pow(x, 2)

Java中平方用Math.pow(x, 2)^表示异或

    inta = (int) Math.pow(10,0);

      intb=(int)Math.pow(10, 1);

      System.out.println("a:"+a); // 1

      System.out.println("b:"+b);// 10