Skip to content

Commit

Permalink
feat: add pow overload (#198)
Browse files Browse the repository at this point in the history
  • Loading branch information
sargunv authored Dec 27, 2024
1 parent 36568e2 commit 709481a
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ public operator fun <U, V : NumberValue<U>> Expression<V>.rem(
public fun Expression<FloatValue>.pow(exponent: Expression<FloatValue>): Expression<FloatValue> =
FunctionCall.of("^", this, exponent).cast()

/** Returns the result of raising this number expression to the power of [exponent]. */
public fun Expression<FloatValue>.pow(exponent: Float): Expression<FloatValue> =
FunctionCall.of("^", this, const(exponent)).cast()

/** Returns the square root of [value]. */
public fun sqrt(value: Expression<FloatValue>): Expression<FloatValue> =
FunctionCall.of("sqrt", value).cast()
Expand Down

0 comments on commit 709481a

Please sign in to comment.