/**
 * In this exercise, you will solve a floating-point error problem by
 * understanding the concept of epsilon. You will write a function that
 * compares two floating-point numbers 'a' and 'b' using a given epsilon
 * value. The aim is to determine if the difference between 'a' and 'b' is
 * within the acceptable range of epsilon.
 *
 * @param a The first floating-point number
 * @param b The second floating-point number
 * @param epsilon The acceptable range for the difference between 'a' and 'b'
 * @return True if the difference between 'a' and 'b' is within the acceptable range
 * of epsilon, False otherwise.
 */
fun compareFloats(a: Double, b: Double, epsilon: Double): Boolean {

    val difference = Math.abs(a - b)   // Calculate the difference between 'a' and 'b'
    
    return difference < epsilon   // Check if the difference is within the acceptable range
}
/**
 * In this exercise, you will solve a floating-point error problem by
 * understanding the concept of epsilon. You will write a function that
 * compares two floating-point numbers 'a' and 'b' using a given epsilon
 * value. The aim is to determine if the difference between 'a' and 'b' is
 * within the acceptable range of epsilon.
 *
 * @param a The first floating-point number
 * @param b The second floating-point number
 * @param epsilon The acceptable range for the difference between 'a' and 'b'
 * @return True if the difference between 'a' and 'b' is within the acceptable range
 * of epsilon, False otherwise.
 */
fun compareFloats(a: Double, b: Double, epsilon: Double): Boolean {
/**
 * In this exercise, you will solve a floating-point error problem by
 * understanding the concept of epsilon. You will write a function that
 * compares two floating-point numbers 'a' and 'b' using a given epsilon
 * value. The aim is to determine if the difference between 'a' and 'b' is
 * within the acceptable range of epsilon.
 *
 * @param a The first floating-point number
 * @param b The second floating-point number
 * @param epsilon The acceptable range for the difference between 'a' and 'b'
 * @return True if the difference between 'a' and 'b' is within the acceptable range
 * of epsilon, False otherwise.
 */
fun compareFloats(a: Double, b: Double, epsilon: Double): Boolean {

    val difference = Math.abs(a - b)   // Calculate the difference between 'a' and 'b'
    
    return difference < epsilon   // Check if the difference is within the acceptable range
}