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

255
Views
Usando pow en KotlinJS en Intellij

Hay una biblioteca llamada kotlin.math que contiene un método pow:

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

y resultado:

 100.0

Sin embargo, Intellij no registra que he importado la función pow, ¿hay algún método pow especial para KotlinJS?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Hay dos versiones diferentes de pow en KotlinJS.

El obsoleto kotlin.js.math.pow que se define como:

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

y la versión de biblioteca estándar kotlin.math.pow que se define como una función de extensión.

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

Por lo tanto, su ejemplo debe cambiarse para que se vea así:

 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!