+6

Kotlins sqrt in Sololearn

How can I compute sqrt of a number in Kotlin? Please provide a oneliner

5/16/2018 7:32:56 PM

Oma Falk

8 Answers

New Answer

+8

I hope this helps you, Oma! https://code.sololearn.com/cQRY8iQAPJPY/?ref=app

+6

not needed to import java.lang.Math.* just see this same example https://code.sololearn.com/clUvmKv6JO8X/?ref=app

+5

Jay Matthews 😘😘😘😘😘

+3

please mention Jay Mathew as a best answer I am just improve there code. and for kotlin question you can ask from John well(MOD)sir he can give you best answer.

+2

I'm just learning Kotlin myself. I just tried that. It didn't work. You have to use java.lang.Math.* to get it to work.

+2

nitish kumar jha that means kotlin.lang is onboard right? do u know kotlin version on SL?

+2

nitish kumar jha there are many ways to say thank you and yes..John is very far with Kotlin

+1

Jay Matthews one more question: I saw kotlin.lang.math . U use java library. It is a question of kotlin version I think. right which version is on SL?