Powers | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 5

Powers

in java how do we express powers i mean with the operators, can i have an example?

2nd Nov 2018, 7:48 PM
Liza BOUMALI
Liza BOUMALI - avatar
1 Answer
+ 2
You can't with operators. ^ is used for 'xor'. You can use Math.pow(num,power)... A sample. https://code.sololearn.com/c0EupxmXvO6I/?ref=app
2nd Nov 2018, 8:22 PM
Amir Galanty
Amir Galanty - avatar