+ 1
Can't import kotlin.math methods.
Title says it all, example at https://code.sololearn.com/cYo4WM2A3cl4/?ref=app. I've tried using java.lang.Math.round(), then casting to Int, but that doesn't work either. Any workarounds?
10 Answers
+ 4
SoloLearn doesn't as yet support 1.2 library features.
+ 3
John Wells
Well that's quite unfortunate. Thanks for the answer, though!
+ 2
I am not able to see the code for some reason can you post the code?
+ 2
roundToInt()
Basically all the math stuff.
+ 1
Tanay
Dang. I basically just tried to import kotlin.math.roundToInt, and it didn't find the math package. Works in everything else I've tried, running in an IDE, running an artifact, and even running it on my phone.
+ 1
what function are you going to call?
+ 1
call Math.round(<value>)
+ 1
what? it exists.
0
That's what I'm doing for a replacement. I was just wondering why the Kotlin standard library seemed to not exist.
0
Not to Sololearn, at least. Doesn't matter too much, I usually just dump codes here for a tertiary backup if it's not a web code or challenge code.