/**
 * The purpose of this exercise is to understand floating-point errors and the importance of using epsilon
 * when comparing two floating-point numbers. The task is to complete the code by implementing a function
 * that compares two floating-point numbers a and b with a very high precision, taking into account any
 * differences within a small delta range specified by epsilon.
 *
 * @param a The first floating-point number to be compared.
 * @param b The second floating-point number to be compared.
 * @return True if the absolute difference between a and b is within epsilon, False otherwise.
 */
fun compareFloats(a: Double, b: Double): Boolean {

    val epsilon = 1e-15  // very small delta range

    // Implement the code to compare a and b using epsilon

    // Subtracting a from b
    val diff = Math.abs(a - b)

    // Check if the absolute difference is within the epsilon range
    return diff <= epsilon
}
/**
 * The purpose of this exercise is to understand floating-point errors and the importance of using epsilon
 * when comparing two floating-point numbers. The task is to complete the code by implementing a function
 * that compares two floating-point numbers a and b with a very high precision, taking into account any
 * differences within a small delta range specified by epsilon.
 *
 * @param a The first floating-point number to be compared.
 * @param b The second floating-point number to be compared.
 * @return True if the absolute difference between a and b is within epsilon, False otherwise.
 */
fun compareFloats(a: Double, b: Double): Boolean {
/**
 * The purpose of this exercise is to understand floating-point errors and the importance of using epsilon
 * when comparing two floating-point numbers. The task is to complete the code by implementing a function
 * that compares two floating-point numbers a and b with a very high precision, taking into account any
 * differences within a small delta range specified by epsilon.
 *
 * @param a The first floating-point number to be compared.
 * @param b The second floating-point number to be compared.
 * @return True if the absolute difference between a and b is within epsilon, False otherwise.
 */
fun compareFloats(a: Double, b: Double): Boolean {

    val epsilon = 1e-15  // very small delta range

    // Implement the code to compare a and b using epsilon

    // Subtracting a from b
    val diff = Math.abs(a - b)

    // Check if the absolute difference is within the epsilon range
    return diff <= epsilon
}