请问有什么功能^
(尖)运算的Java服务?
当我尝试这个:
int a = 5^n;
Run Code Online (Sandbox Code Playgroud)
......它给了我:
对于n = 5,
对于n = 4 返回0 ,
对于n = 6 返回1 ,返回3
...所以我猜它不会执行取幂.但那又是什么呢?
运算符是^
用来做什么的?它不适用于幂函数:
#include <iostream>
int main(){
int x, y;
cout << (x^y) << endl; /* this is the unkown (X^Y)*/
return 0;
}
Run Code Online (Sandbox Code Playgroud)