/**
 * This function calculates the rounding error between two floating-point numbers.
 */
fun calculateRoundingError(num1: Double, num2: Double): Double {

    val roundingError = Math.abs(num1.round(10) - num2.round(10))
    return roundingError
}

fun Double.round(decimals: Int): Double {
    var multiplier = 1.0
    repeat(decimals) { multiplier *= 10 }
    return Math.round(this * multiplier) / multiplier
}
/**
 * This function calculates the rounding error between two floating-point numbers.
 */
fun calculateRoundingError(num1: Double, num2: Double): Double {
/**
 * This function calculates the rounding error between two floating-point numbers.
 */
fun calculateRoundingError(num1: Double, num2: Double): Double {

    val roundingError = Math.abs(num1.round(10) - num2.round(10))
    return roundingError
}

fun Double.round(decimals: Int): Double {
    var multiplier = 1.0
    repeat(decimals) { multiplier *= 10 }
    return Math.round(this * multiplier) / multiplier
}