/**
 * Compares two floating-point numbers with a tolerance value (epsilon) to handle floating-point errors.
 *
 * @param float1 a floating-point number
 * @param float2 a floating-point number
 * @return true if the absolute difference between float1 and float2 is less than epsilon, false otherwise
 */
fun compareFloats(float1: Double, float2: Double): Boolean {

    val epsilon = 1e-9  // A small tolerance value to handle floating-point errors
    return Math.abs(float1 - float2) < epsilon
}
/**
 * Compares two floating-point numbers with a tolerance value (epsilon) to handle floating-point errors.
 *
 * @param float1 a floating-point number
 * @param float2 a floating-point number
 * @return true if the absolute difference between float1 and float2 is less than epsilon, false otherwise
 */
fun compareFloats(float1: Double, float2: Double): Boolean {
/**
 * Compares two floating-point numbers with a tolerance value (epsilon) to handle floating-point errors.
 *
 * @param float1 a floating-point number
 * @param float2 a floating-point number
 * @return true if the absolute difference between float1 and float2 is less than epsilon, false otherwise
 */
fun compareFloats(float1: Double, float2: Double): Boolean {

    val epsilon = 1e-9  // A small tolerance value to handle floating-point errors
    return Math.abs(float1 - float2) < epsilon
}