Skip to content
This repository was archived by the owner on Feb 23, 2020. It is now read-only.

Commit 01dbac0

Browse files
committed
Add Float and Double pow functions
1 parent 26bebdd commit 01dbac0

File tree

2 files changed

+24
-3
lines changed

2 files changed

+24
-3
lines changed

.idea/codeStyleSettings.xml

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/linq/lamdba/DefaultLambdaFunctions.kt

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ open class DefaultLambdaFunctions {
169169
fun Pow(a: Short, b: Short) : Short{
170170
return Math.pow(a.toDouble(),b.toDouble()).toShort()
171171
}
172-
172+
173173
@JvmStatic()
174174
fun InRange(a: Long, b: Long) : Boolean{
175175
return a <= b
@@ -248,7 +248,7 @@ open class DefaultLambdaFunctions {
248248
fun Pow(a: Long, b: Long) : Long{
249249
return Math.pow(a.toDouble(),b.toDouble()).toLong()
250250
}
251-
251+
252252
@JvmStatic()
253253
fun InRange(a: Float, b: Float) : Boolean{
254254
return a <= b
@@ -299,7 +299,10 @@ open class DefaultLambdaFunctions {
299299
fun Mod(a: Float, b: Float) : Float{
300300
return a.mod(b)
301301
}
302-
302+
@JvmStatic()
303+
fun Pow(a: Float, b: Float) : Float{
304+
return Math.pow(a.toDouble(),b.toDouble()).toFloat()
305+
}
303306
@JvmStatic()
304307
fun InRange(a: Double, b: Double) : Boolean{
305308
return a <= b
@@ -350,6 +353,11 @@ open class DefaultLambdaFunctions {
350353
fun Mod(a: Double, b: Double) : Double{
351354
return a.mod(b)
352355
}
356+
357+
@JvmStatic()
358+
fun Pow(a: Double, b: Double) : Double{
359+
return Math.pow(a,b)
360+
}
353361

354362
}
355363
}

0 commit comments

Comments
 (0)