What is the Kotlin exponent operator

后端 未结 5 690
春和景丽
春和景丽 2021-01-07 17:33

What is the exponent operator in Kotlin. I assumed it would be ** but it seems to throw up an error in my code.

when (pendingOperation) {
    \"         


        
5条回答
  •  粉色の甜心
    2021-01-07 17:56

    Here's another way to solve this problem:

       "a^b" -> operand1 = (operand1!! + 0.0).pow(value + 0.0).toInt()
    

提交回复
热议问题