Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

257
Views
Using pow in KotlinJS in Intellij

There is a library called kotlin.math which contains a method pow:

import kotlin.math.pow
val factor = pow(10.0, 2)
print(factor)

and result:

100.0

However Intellij is not registering that I have imported the pow function, is there a special pow method for KotlinJS?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

There are two different versions of pow in KotlinJS.

The deprecated kotlin.js.math.pow which is defined as:

public fun pow(base: Double, exp: Double): Double

and the standard library version kotlin.math.pow which is defined as an extension function.

public actual inline fun Double.pow(n: Int): Double = nativeMath.pow(this, n.toDouble())

So your example has to be changed to look like this:

import kotlin.math.pow
val factor = 10.0.pow(2)
print(factor)
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!