diff --git a/lib/maplibre-compose-expressions/src/commonMain/kotlin/dev/sargunv/maplibrecompose/expressions/dsl/math.kt b/lib/maplibre-compose-expressions/src/commonMain/kotlin/dev/sargunv/maplibrecompose/expressions/dsl/math.kt index 188292e7..aa8d869f 100644 --- a/lib/maplibre-compose-expressions/src/commonMain/kotlin/dev/sargunv/maplibrecompose/expressions/dsl/math.kt +++ b/lib/maplibre-compose-expressions/src/commonMain/kotlin/dev/sargunv/maplibrecompose/expressions/dsl/math.kt @@ -74,6 +74,10 @@ public operator fun > Expression.rem( public fun Expression.pow(exponent: Expression): Expression = FunctionCall.of("^", this, exponent).cast() +/** Returns the result of raising this number expression to the power of [exponent]. */ +public fun Expression.pow(exponent: Float): Expression = + FunctionCall.of("^", this, const(exponent)).cast() + /** Returns the square root of [value]. */ public fun sqrt(value: Expression): Expression = FunctionCall.of("sqrt", value).cast()