initial commit
Some checks failed
/ publish (push) Has been cancelled

This commit is contained in:
2025-07-12 18:13:30 +02:00
commit 2e22903d18
17 changed files with 845 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
package com.infendro.encoding.util
import kotlin.math.log2
internal fun log2(
value: Int,
): Double {
val x = value.toDouble()
return log2(x)
}
internal fun gcd(
a: Int,
b: Int,
): Int {
var x = a
var y = b
while (y != 0) {
val temp = y
y = x % y
x = temp
}
return x
}
internal fun lcm(
a: Int,
b: Int,
): Int {
return (a * b) / gcd(a, b)
}