/**
 * Given a floating-point number 'value' and a precision 'precision', return the value rounded to the
 * given precision.
 *
 * @param value The input floating-point number.
 * @param precision The desired precision.
 * @return The rounded value.
 *
 * Example:
 * roundPrecise(3.14159, 2) => 3.14
 */
fun roundPrecise(value: Double, precision: Int): Double {

    val power = Math.pow(10.0, precision.toDouble()).toInt()
    val integerValue = (value * power).toInt()
    val roundedValue = integerValue.toDouble() / power
    return roundedValue
}
/**
 * Given a floating-point number 'value' and a precision 'precision', return the value rounded to the
 * given precision.
 *
 * @param value The input floating-point number.
 * @param precision The desired precision.
 * @return The rounded value.
 *
 * Example:
 * roundPrecise(3.14159, 2) => 3.14
 */
fun roundPrecise(value: Double, precision: Int): Double {
/**
 * Given a floating-point number 'value' and a precision 'precision', return the value rounded to the
 * given precision.
 *
 * @param value The input floating-point number.
 * @param precision The desired precision.
 * @return The rounded value.
 *
 * Example:
 * roundPrecise(3.14159, 2) => 3.14
 */
fun roundPrecise(value: Double, precision: Int): Double {

    val power = Math.pow(10.0, precision.toDouble()).toInt()
    val integerValue = (value * power).toInt()
    val roundedValue = integerValue.toDouble() / power
    return roundedValue
}