Abel
04/08/2021, 5:24 PMYoussef Shoaib [MOD]
04/08/2021, 5:44 PMpublic operator fun Double.powOper(other: Int): Int = pow(other)
, or you can even define it yourself in the source code that you're compiling.Abel
04/08/2021, 5:54 PMYoussef Shoaib [MOD]
04/08/2021, 6:05 PMYoussef Shoaib [MOD]
04/08/2021, 6:06 PMfun main(){
println(5.0 ** 2) // should print 25
}
// Add the powOper definition here then to make it work
operator fun Double.powOper(other: Int): Double = this.pow(other)
shikasd
04/08/2021, 6:11 PMshikasd
04/08/2021, 6:12 PMAbel
04/08/2021, 7:16 PMYoussef Shoaib [MOD]
04/08/2021, 9:21 PM