Skip to content

Commit 5166dec

Browse files
committed
Added more square extensions
1 parent c7924df commit 5166dec

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

common/src/main/kotlin/com/lambda/util/math/MathUtils.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ object MathUtils {
2626
private const val PI_FLOAT = 3.141593f
2727

2828
inline val Int.sq: Int get() = this * this
29+
inline val Float.sq: Float get() = this * this
30+
inline val Double.sq: Double get() = this * this
2931

3032
fun Float.toRadian() = this / 180.0f * PI_FLOAT
3133
fun Double.toRadian() = this / 180.0 * PI

0 commit comments

Comments
 (0)